Skip to content

Commit 6991d9a

Browse files
committed
don't focus the search input while fetching
When triggering a search the input field would receive focus again when the spinner page shows. On mobile this is annoying, as the keyboard pops up again for no reason. We now only autofocus on the start (aka. home) page.
1 parent d568a7a commit 6991d9a

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

www/app/views/home/show.html.slim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
= render 'shared/search_box'
1+
= render 'shared/search_box', autofocus: true
22

33
= render 'shared/random_quote'

www/app/views/shared/_search_box.html.slim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/# locals: (query: nil)
1+
/# locals: (query: nil, autofocus: false)
22
33
section.box.padded[
44
data-controller="search-autocomplete"
@@ -14,7 +14,7 @@ section.box.padded[
1414
value=query
1515
data-search-autocomplete-target="input"
1616
data-action="click->search-autocomplete#reopen"
17-
autofocus=true
17+
autofocus=autofocus
1818
]
1919

2020
dialog data-dialog-target='dialog'

0 commit comments

Comments
 (0)