Skip to content
This repository was archived by the owner on Jan 9, 2023. It is now read-only.

Commit c9656cd

Browse files
committed
fix(input): replace selected with defaultValue in select
fix #271
1 parent a791422 commit c9656cd

1 file changed

Lines changed: 13 additions & 15 deletions

File tree

stories/select.stories.tsx

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ storiesOf('Select', module)
9898

9999
.add('Working with value', () => (
100100
<div>
101-
<Select value="nougat">
101+
<Select defaultValue="nougat">
102102
<option value="marshmallow">Marshmallow</option>
103103
<option value="nougat">Nougat</option>
104104
<option value="icecream">Ice cream</option>
@@ -108,30 +108,28 @@ storiesOf('Select', module)
108108
))
109109
.add('Small select', () => (
110110
<div>
111-
<Select value="nougat" size="small">
112-
<option value="marshmallow">Marshmallow</option>
113-
<option value="nougat">Nougat</option>
114-
<option value="icecream">Ice cream</option>
115-
<option value="gingerbread">Gingerbread</option>
111+
<Select defaultValue="nougat" size="small">
112+
<option>Marshmallow</option>
113+
<option>Nougat</option>
114+
<option>Ice cream</option>
115+
<option>Gingerbread</option>
116116
</Select>
117117
</div>
118118
))
119119
.add('Large select', () => (
120120
<div>
121-
<Select value="nougat" size="large">
122-
<option value="marshmallow">Marshmallow</option>
123-
<option value="nougat">Nougat</option>
124-
<option value="icecream">Ice cream</option>
125-
<option value="gingerbread">Gingerbread</option>
121+
<Select defaultValue="Choose your sweet" size="large">
122+
<option>Marshmallow</option>
123+
<option>Nougat</option>
124+
<option>Ice cream</option>
125+
<option>Gingerbread</option>
126126
</Select>
127127
</div>
128128
))
129129
.add('Custom class', () => (
130130
<div>
131-
<Select className="customClass">
132-
<option selected disabled>
133-
Choose your sweet
134-
</option>
131+
<Select defaultValue="Choose your sweet" className="customClass">
132+
<option disabled>Choose your sweet</option>
135133
<option>Marshmallow</option>
136134
<option>Nougat</option>
137135
<option>Ice cream</option>

0 commit comments

Comments
 (0)