File tree Expand file tree Collapse file tree
apps/desktop/src/lib/settings/sections Expand file tree Collapse file tree Original file line number Diff line number Diff line change 285285 // Let Tab through for focus navigation
286286 if (event .key === ' Tab' ) return
287287
288+ // ESC clears the filter when it has a value; otherwise let it bubble (closes window)
289+ if (event .key === ' Escape' ) {
290+ if (keySearchQuery ) {
291+ event .preventDefault ()
292+ event .stopImmediatePropagation ()
293+ keySearchQuery = ' '
294+ }
295+ return
296+ }
297+
288298 event .preventDefault ()
289299 event .stopPropagation ()
290300
354364 autocapitalize =" off"
355365 spellcheck =" false"
356366 />
357- <input
358- type =" text"
359- class =" search-input key-search"
360- placeholder =" Filter by keys..."
361- bind:value ={keySearchQuery }
362- bind:this ={keyFilterInput }
363- onkeydown ={handleKeyFilterKeyDown }
364- onkeyup ={handleKeyFilterKeyUp }
365- autocomplete =" off"
366- autocapitalize =" off"
367- spellcheck =" false"
368- />
367+ <div class =" key-search-wrapper" >
368+ <input
369+ type =" text"
370+ class =" search-input key-search"
371+ placeholder =" Filter by keys..."
372+ bind:value ={keySearchQuery }
373+ bind:this ={keyFilterInput }
374+ onkeydown ={handleKeyFilterKeyDown }
375+ onkeyup ={handleKeyFilterKeyUp }
376+ autocomplete =" off"
377+ autocapitalize =" off"
378+ spellcheck =" false"
379+ />
380+ <span class ="key-search-hint" class:visible ={!! keySearchQuery }>Press ESC to clear</span >
381+ </div >
369382 </div >
370383
371384 <div class =" filters" >
532545 box-shadow : var (--shadow-focus );
533546 }
534547
535- .key-search {
548+ .key-search-wrapper {
536549 flex : 0.5 ;
550+ position : relative ;
551+ }
552+
553+ .key-search {
554+ width : 100% ;
555+ }
556+
557+ .key-search-hint {
558+ position : absolute ;
559+ top : 100% ;
560+ left : 0 ;
561+ margin-top : 2px ;
562+ font-size : var (--font-size-xs );
563+ color : var (--color-text-tertiary );
564+ opacity : 0 ;
565+ transition : opacity 0.15s ;
566+ }
567+
568+ .key-search-hint.visible {
569+ opacity : 1 ;
537570 }
538571
539572 .filters {
You can’t perform that action at this time.
0 commit comments