Skip to content

Commit ca0f05e

Browse files
test(select-field): add story for button interaction below SelectField
1 parent 27c2a51 commit ca0f05e

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

packages/bento-design-system/stories/Components/SelectField.stories.tsx

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ import {
88
BentoConfigProvider,
99
SelectFieldProps,
1010
SelectOption,
11+
Button,
12+
Stack,
1113
} from "..";
1214
import { useState } from "react";
1315

@@ -213,3 +215,22 @@ export const NotClearable = {
213215
);
214216
},
215217
} satisfies Story;
218+
219+
// Story to test ghost click prevention on touch devices
220+
export const WithButtonBelow = {
221+
render: (args) => {
222+
const [value, onChange] = useState<number | undefined>(undefined);
223+
const [clickCount, setClickCount] = useState(0);
224+
return (
225+
<Stack space={16}>
226+
<SelectField {...args} value={value} onChange={(v) => onChange(v as number)} />
227+
<Button
228+
kind="solid"
229+
hierarchy="primary"
230+
label={`Button clicked ${clickCount} times`}
231+
onPress={() => setClickCount((c) => c + 1)}
232+
/>
233+
</Stack>
234+
);
235+
},
236+
} satisfies Story;

0 commit comments

Comments
 (0)