Skip to content

Commit

Permalink
Merge pull request #824 from buildo/disable_select_autoopenonfocus
Browse files Browse the repository at this point in the history
Allow control of Select open-on-focus behavior
  • Loading branch information
federico-ercoles authored Jan 25, 2024
2 parents fd1c215 + 074f156 commit 99a44a7
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ export function BaseSelect<A>(props: Props<A>) {
placeholder={placeholder}
menuPortalTarget={menuPortalTarget.current}
components={selectComponents}
openMenuOnFocus
openMenuOnFocus={props.openMenuOnFocus ?? dropdownConfig.openMenuOnFocus}
styles={selectComponents.styles<SelectOption<A>>()}
validationState={validationState}
isMulti={isMulti}
Expand Down
1 change: 1 addition & 0 deletions packages/bento-design-system/src/SelectField/Config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ export type DropdownConfig = {
openIndicatorIconSize: IconProps["size"];
chipColor: ChipProps["color"];
chipSpacing: BentoSprinkles["gap"];
openMenuOnFocus: boolean;
};
1 change: 1 addition & 0 deletions packages/bento-design-system/src/SelectField/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,5 @@ export type BaseSelectProps<A> = {
noOptionsMessage?: LocalizedString;
isReadOnly?: boolean;
searchable?: boolean;
openMenuOnFocus?: boolean;
};
1 change: 1 addition & 0 deletions packages/bento-design-system/src/util/defaultConfigs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,7 @@ export const dropdown: DropdownConfig = {
openIndicatorIconSize: 24,
chipColor: "indigo",
chipSpacing: 4,
openMenuOnFocus: true,
};

export const table: TableConfig = {
Expand Down

0 comments on commit 99a44a7

Please sign in to comment.