Skip to content

Commit

Permalink
Merge branch 'main' into fix/disabled-elems-selection
Browse files Browse the repository at this point in the history
  • Loading branch information
IsaevAlexandr authored Jul 16, 2024
2 parents 02123f0 + 88696a3 commit 6d55549
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/components/TreeSelect/TreeSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ export const TreeSelect = React.forwardRef(function TreeSelect<T>(
items,
value: propsValue,
defaultValue,
placeholder,
disabled = false,
withExpandedState = true,
defaultExpandedState = 'expanded',
Expand Down Expand Up @@ -153,6 +154,7 @@ export const TreeSelect = React.forwardRef(function TreeSelect<T>(
const controlProps: TreeSelectRenderControlProps<T> = {
list,
open,
placeholder,
toggleOpen,
clearValue: () => list.state.setSelected({}),
ref: handleControlRef,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ const DefaultTemplate: StoryFn<
<Flex>
<TreeSelect
{...props}
placeholder="-"
items={items}
mapItemDataToProps={(x) => x}
onItemClick={({id, list}) => {
Expand Down
4 changes: 3 additions & 1 deletion src/components/TreeSelect/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ import type {UseListParsedStateProps} from '../useList/hooks/useListParsedState'
export type TreeSelectRenderControlProps<T> = {
list: UseListResult<T>;
open: boolean;
disabled: boolean;
disabled?: boolean;
placeholder?: string;
toggleOpen(): void;
clearValue(): void;
ref: React.Ref<HTMLButtonElement>;
Expand Down Expand Up @@ -46,6 +47,7 @@ export interface TreeSelectProps<T, P extends {} = {}>
title?: string;
value?: ListItemId[];
disabled?: boolean;
placeholder?: string;
defaultValue?: ListItemId[] | undefined;
popupClassName?: string;
popupWidth?: SelectPopupProps['width'];
Expand Down

0 comments on commit 6d55549

Please sign in to comment.