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[]>(
163163
164164 return {
165165 "defaultValue" : isEmptyValueSelected
166- ? ""
166+ ? nativeSelectProps ?. defaultValue ?? ""
167167 : ( ( ) => {
168168 const selectedOption = options . find ( option => option . selected ) ;
169169 assert ( selectedOption !== undefined ) ;
Original file line number Diff line number Diff line change @@ -222,6 +222,26 @@ export const Default = getStory({
222222 options
223223} ) ;
224224
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+
225245export const DefaultWithPlaceholder = getStory ( {
226246 "label" : "Label pour liste déroulante" ,
227247 "placeholder" : "Sélectionnez une option" ,
You can’t perform that action at this time.
0 commit comments