File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -30,14 +30,18 @@ function expandMobileSearch() {
3030 })
3131}
3232
33- watch (isOnSearchPage , visible => {
34- if (! visible ) return
33+ watch (
34+ isOnSearchPage ,
35+ visible => {
36+ if (! visible ) return
3537
36- searchBoxRef .value ?.focus ()
37- nextTick (() => {
3838 searchBoxRef .value ?.focus ()
39- })
40- })
39+ nextTick (() => {
40+ searchBoxRef .value ?.focus ()
41+ })
42+ },
43+ { flush: ' sync' },
44+ )
4145
4246function handleSearchBlur() {
4347 showFullSearch .value = false
Original file line number Diff line number Diff line change @@ -11,6 +11,10 @@ async function search() {
1111 path: ' /search' ,
1212 query: query ? { q: query } : undefined ,
1313 })
14+ const newQuery = searchQuery .value .trim ()
15+ if (newQuery !== query ) {
16+ await search ()
17+ }
1418}
1519
1620const handleInput = isTouchDevice ()
You can’t perform that action at this time.
0 commit comments