Skip to content

Commit

Permalink
Add default value for Search bar choice control
Browse files Browse the repository at this point in the history
  • Loading branch information
vesnushka committed Dec 3, 2024
1 parent 597d7fb commit 9aceceb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/SearchBar/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export function useSearchBar(props: SearchBarProps): SearchBarData {
}

if (isChoiceColumn(column)) {
return { column, value: null };
return { column, value: column.defaultValue ? [column.defaultValue] : null };
}

if (isSolidChoiceColumn(column)) {
Expand Down
1 change: 1 addition & 0 deletions src/components/SearchBar/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export type SearchBarChoiceColumn = {
type: SearchBarColumnType.CHOICE;
repeats?: boolean;
placeholder: string;
defaultValue?: ValueSetOption;
} & (
| {
options: ValueSetOption[];
Expand Down

0 comments on commit 9aceceb

Please sign in to comment.