File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed
src/core/components/settings/new-panel Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -161,9 +161,21 @@ export function ManualClasses() {
161161 } , 0 ) ;
162162 } ,
163163 onKeyDown : ( e : any ) => {
164- if ( e . key === "Enter" && newCls . trim ( ) !== "" && suggestions . length === 0 ) {
164+ if ( e . key === "Enter" && newCls . trim ( ) !== "" ) {
165+ e . preventDefault ( ) ;
165166 addNewClasses ( ) ;
166167 }
168+ if ( e . key === "Tab" && suggestions . length > 0 ) {
169+ e . preventDefault ( ) ;
170+ // Simulate ArrowDown to highlight
171+ const downEvent = new KeyboardEvent ( "keydown" , {
172+ key : "ArrowDown" ,
173+ code : "ArrowDown" ,
174+ keyCode : 40 ,
175+ bubbles : true ,
176+ } ) ;
177+ e . target . dispatchEvent ( downEvent ) ;
178+ }
167179 } ,
168180 onChange : ( _e : any , { newValue } : any ) => setNewCls ( newValue ) ,
169181 className : "w-full rounded-md text-xs px-2 hover:outline-0 bg-background border-border py-1" ,
@@ -225,7 +237,6 @@ export function ManualClasses() {
225237 getSuggestionValue = { getSuggestionValue }
226238 renderSuggestion = { renderSuggestion }
227239 inputProps = { inputProps }
228- highlightFirstSuggestion = { true }
229240 onSuggestionSelected = { ( _e , { suggestionValue } ) => {
230241 const storageFormat = convertToStorageFormat ( suggestionValue ) ;
231242 addClassesToBlocks ( selectedIds , [ storageFormat ] , true ) ;
You can’t perform that action at this time.
0 commit comments