File tree Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -163,7 +163,7 @@ function NonMemoizedNonForwardedSelect<T extends SelectProps.Option[]>(
163
163
164
164
return {
165
165
"defaultValue" : isEmptyValueSelected
166
- ? ""
166
+ ? nativeSelectProps ?. defaultValue ?? ""
167
167
: ( ( ) => {
168
168
const selectedOption = options . find ( option => option . selected ) ;
169
169
assert ( selectedOption !== undefined ) ;
Original file line number Diff line number Diff line change @@ -222,6 +222,26 @@ export const Default = getStory({
222
222
options
223
223
} ) ;
224
224
225
+ export const DefaultWithSelectedOption = getStory ( {
226
+ "label" : "Label pour liste déroulante" ,
227
+ options : [
228
+ ...options ,
229
+ {
230
+ "value" : "4" ,
231
+ "label" : "Option 4" ,
232
+ "selected" : true
233
+ }
234
+ ]
235
+ } ) ;
236
+
237
+ export const DefaultWithDefaultValue = getStory ( {
238
+ "label" : "Label pour liste déroulante" ,
239
+ options,
240
+ "nativeSelectProps" : {
241
+ "defaultValue" : "2"
242
+ }
243
+ } ) ;
244
+
225
245
export const DefaultWithPlaceholder = getStory ( {
226
246
"label" : "Label pour liste déroulante" ,
227
247
"placeholder" : "Sélectionnez une option" ,
You can’t perform that action at this time.
0 commit comments