File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -174,6 +174,9 @@ const SelectPanel = () => {
174174 getFilteredOptions ( ) . then ( setFilteredOptions ) ;
175175 } , [ searchTextForFilter , options ] ) ;
176176
177+ const creationRef : any = useRef ( )
178+ useKey ( [ KEY . ENTER ] , handleOnCreateOption , { target : creationRef } ) ;
179+
177180 return (
178181 < div className = "select-panel" role = "listbox" ref = { listRef } >
179182 { ! disableSearch && (
@@ -220,7 +223,7 @@ const SelectPanel = () => {
220223 onClick = { ( _e , index ) => handleItemClicked ( index ) }
221224 />
222225 ) : isCreatable ? (
223- < li onClick = { handleOnCreateOption } className = "select-item creatable" >
226+ < li onClick = { handleOnCreateOption } className = "select-item creatable" tabIndex = { skipIndex === 1 ? 0 : 1 } ref = { creationRef } >
224227 { `${ t ( "create" ) } "${ searchText } "` }
225228 </ li >
226229 ) : (
You can’t perform that action at this time.
0 commit comments