Skip to content

Commit 0ac9dc1

Browse files
committed
docs(Select): enhance story
1 parent a41e7fe commit 0ac9dc1

File tree

1 file changed

+32
-16
lines changed

1 file changed

+32
-16
lines changed

packages/main/src/webComponents/Select/Select.stories.mdx

Lines changed: 32 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { ArgsTable, Canvas, Meta, Story } from '@storybook/addon-docs/blocks';
2-
import { createSelectArgTypes } from '@shared/stories/createSelectArgTypes';
3-
import { DocsHeader } from '@shared/stories/DocsHeader';
4-
import { Option } from '@ui5/webcomponents-react/lib/Option';
52
import { Select } from '@ui5/webcomponents-react/lib/Select';
63
import { ValueState } from '@ui5/webcomponents-react/lib/ValueState';
4+
import { Option } from '@ui5/webcomponents-react/lib/Option';
5+
import { createSelectArgTypes } from '@shared/stories/createSelectArgTypes';
6+
import { DocsHeader } from '@shared/stories/DocsHeader';
77
import { DocsCommonProps } from '@shared/stories/DocsCommonProps';
88

99
<Meta
@@ -13,32 +13,48 @@ import { DocsCommonProps } from '@shared/stories/DocsCommonProps';
1313
argTypes={{
1414
...createSelectArgTypes({ valueState: ValueState }),
1515
...DocsCommonProps,
16-
children: {
17-
type: null
18-
}
16+
children: { control: { disable: true } },
17+
valueStateMessage: { control: { disable: true } }
1918
}}
2019
args={{
21-
valueState: ValueState.None
20+
valueState: ValueState.None,
21+
style: {},
22+
className: '',
23+
tooltip: '',
24+
slot: '',
25+
ref: null
2226
}}
2327
/>
2428

2529
<DocsHeader />
2630

2731
<Canvas>
2832
<Story name="Default">
29-
{(props) => (
30-
<Select disabled={props.disabled} name={props.name} valueState={props.valueState} onChange={props.onChange}>
31-
<Option>Option 1</Option>
32-
<Option>Option 2</Option>
33-
<Option>Option 3</Option>
34-
<Option>Option 4</Option>
35-
<Option>Option 5</Option>
36-
</Select>
37-
)}
33+
{(args) => {
34+
return (
35+
<Select {...args}>
36+
<Option>Option 1</Option>
37+
<Option>Option 2</Option>
38+
<Option>Option 3</Option>
39+
<Option>Option 4</Option>
40+
<Option>Option 5</Option>
41+
</Select>
42+
);
43+
}}
3844
</Story>
3945
</Canvas>
4046

4147
<ArgsTable story="." />
48+
<div style={{ fontFamily: 'var(--sapFontFamily)', fontSize: 'var(--sapFontSize)', color: 'var(--sapTextColor)' }}>
49+
<h3>Keyboard Handling</h3>
50+
The <code>Select</code> provides advanced keyboard handling. If the <code>Select</code> is focused, you can open or close
51+
the drop-down by pressing <code>F4</code>, <code>ALT+UP</code> or <code>ALT+DOWN</code> keys. Once the drop-down is opened,
52+
you can use the <code>UP</code> and <code>DOWN</code> arrow keys to navigate through the available options and select one
53+
by pressing the <code>Space</code> or <code>Enter</code> keys. <br />
54+
</div>
55+
56+
<br />
57+
<br />
4258

4359
## Recipes
4460

0 commit comments

Comments
 (0)