File tree Expand file tree Collapse file tree
templates/default/fulldoc/html/js Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33 let searchTimeout = null ;
44 const searchCache = [ ] ;
55 let caseSensitiveMatch = false ;
6- const ignoreKeyCodeMin = 8 ;
7- const ignoreKeyCodeMax = 46 ;
8- const commandKey = 91 ;
96
107 function query ( selector , root ) {
118 return ( root || document ) . querySelector ( selector ) ;
151148
152149 if ( ! input || ! fullList ) return ;
153150
154- input . addEventListener ( "keyup" , ( event ) => {
155- if ( ignoredKeyPress ( event ) ) return ;
151+ function updateSearchResults ( ) {
156152 if ( input . value === "" ) {
157153 clearSearch ( ) ;
158154 } else {
159155 performSearch ( input . value ) ;
160156 }
161- } ) ;
157+ }
158+
159+ input . addEventListener ( "input" , updateSearchResults ) ;
160+ input . addEventListener ( "change" , updateSearchResults ) ;
162161
163162 fullList . insertAdjacentHTML (
164163 "afterend" ,
165164 "<div id='noresults' role='status' style='display: none'></div>" ,
166165 ) ;
167166 }
168167
169- function ignoredKeyPress ( event ) {
170- return (
171- ( event . keyCode > ignoreKeyCodeMin && event . keyCode < ignoreKeyCodeMax ) ||
172- event . keyCode === commandKey
173- ) ;
174- }
175-
176168 function clearSearch ( ) {
177169 clearSearchTimeout ( ) ;
178170 queryAll ( "#full_list .found" ) . forEach ( ( node ) => {
You can’t perform that action at this time.
0 commit comments