Skip to content

Commit 8704df9

Browse files
fix(select-field): add onClick stopPropagation and preventDefault
1 parent ca0f05e commit 8704df9

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

packages/bento-design-system/src/SelectField/components.tsx

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,9 +228,17 @@ export function MenuList<A extends { disabled?: boolean }>(props: MenuListProps<
228228
}
229229

230230
export function Option<B, A extends SelectOption<B>>(props: OptionProps<A>) {
231-
const { onClick, ...innerProps } = props.innerProps;
232231
return (
233-
<defaultComponents.Option {...props} innerProps={innerProps}>
232+
<defaultComponents.Option
233+
{...props}
234+
innerProps={{
235+
...props.innerProps,
236+
onClick: (e) => {
237+
e.stopPropagation();
238+
e.preventDefault();
239+
},
240+
}}
241+
>
234242
<ListItem
235243
{...props.data}
236244
size={props.selectProps.menuSize ?? "medium"}

0 commit comments

Comments
 (0)