File tree 1 file changed +8
-2
lines changed
1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change 59
59
const query = target ?.value .trim ();
60
60
if (! query ) return ;
61
61
if (query ) {
62
+ // Enable autofocus before running `goto` because on chromium
63
+ // the .focus() call won't work, even after a timeout.
64
+ // Using autofocus seems to work. Disables after goto runs.
65
+ // https://github.com/sbondCo/Watcharr/issues/169
66
+ target .autofocus = true ;
62
67
goto (` /search/${query } ` ).then (() => {
63
68
target ?.focus ();
69
+ target .autofocus = false ;
64
70
});
65
71
}
66
72
},
171
177
let scroll = window .scrollY ;
172
178
window .document .addEventListener (" scroll" , (ev : Event ) => {
173
179
if (scroll > window .scrollY ) {
174
- navEl .classList .remove (" scrolled-down" );
180
+ navEl ? .classList .remove (" scrolled-down" );
175
181
} else {
176
- navEl .classList .add (" scrolled-down" );
182
+ navEl ? .classList .add (" scrolled-down" );
177
183
subMenuShown = false ;
178
184
filterMenuShown = false ;
179
185
sortMenuShown = false ;
You can’t perform that action at this time.
0 commit comments