Theme: enable autofocus of #q only on the index page and when the width > 50em #1272
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Currently the search input is auto focused except on mobile.
See issue #1270 : on the result page, in a small window on desktop, the result are hidden.
This PR enable the autofocus of the search input only on the index page and when the width is above 50em.
About
.index_endpoint, the value is set in base.html :searxng/searx/templates/simple/base.html
Line 30 in 96dc436
The
endpointJinja2 variable is set torequest.endpointin therenderfunction :searxng/searx/webapp.py
Line 451 in 96dc436
So the value is
index_endpointfor/preferences_endpointfor/preferencesresults_endpointfor/search(the expect value issearch_endpoint, theresults_endpointvalue is a legacy from the time where/?q=%swas not a redirect ; this does not matter in this PR).Why is this change important?
Improve the UX.
How to test this PR locally?
Author's checklist
Related issues
Related to #1270