-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug] New search field auto focusing prevents alternate inputs on page load #2791
Comments
Yes, that was a user request (#277). |
Same problem here, I'd be really grateful for a way to disable this (or to have it disabled on video pages, because it doesn't really make sense there). For now you can just patch it out: From 0fa08e63e778d0b30d3acd1bb28b6e40c75567bb Mon Sep 17 00:00:00 2001
From: Marko Zajc <marko@zajc.eu.org>
Date: Sat, 8 Jan 2022 00:39:37 +0100
Subject: [PATCH] Disable input autofocus
---
src/invidious/views/components/search_box.ecr | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/invidious/views/components/search_box.ecr b/src/invidious/views/components/search_box.ecr
index 4144d161..165d8623 100644
--- a/src/invidious/views/components/search_box.ecr
+++ b/src/invidious/views/components/search_box.ecr
@@ -1,7 +1,7 @@
<form class="pure-form" action="/search" method="get">
<fieldset>
<input type="search" id="searchbox" autocomplete="off" autocorrect="off"
- autocapitalize="none" spellcheck="false" autofocus name="q"
+ autocapitalize="none" spellcheck="false" name="q"
placeholder="<%= translate(locale, "search") %>"
title="<%= translate(locale, "search") %>"
value="<%= env.get?("search").try {|x| HTML.escape(x.as(String)) } %>">
--
2.30.2 |
Hmm, I also use keys for scrolling on search pages (both normal queries and when searching channels). From the linked ticket I'm not sure how much consideration the OP gave the idea. The feature request tickets they reference to support their proposal (#449 and #996) were also only for autofocus for a landing page rather than everywhere.
Thing is, as we can see it does interfere with other keyboard inputs (including playback) and I've since noticed it disrupts Vivaldi's native spatial navigation since arrow keys are initially confined in the text field. It seems like they might not have realized what effect it would have. Pressing the Tab key to focus the search seems the clearest middle ground and the standard behavior of most search fields on search-focused sites, which makes me curious if that was considered one step to much for some, though pull #513 mentions moving the mouse as annoying and doesn't mention Tab, which is quicker, making me wonder if they just weren't used to it. |
FWIW, I'm also not a fan. |
Ok, thanks all for your feedback :) |
I've personally disabled the autofocus on yewtu.be |
Thanks. I use your instance reasonably often. I also managed to disable the search field for other public instances for the time being with a
css directive in palemoon for the time being. This allows me to instantly scroll the page with the keyboard on page-load, which is all I care about. |
I'm working on a fix right now. There will be a PR soon. |
@chocmake @markozajc @garoto the PR is deployed on https://yewtu.be. Mind giving a feedback? |
@SamantazFox looks good, cheers 👍 And from what I tried the first order Tab press is the search field, in every page type I checked, for those after quick focused access to it. |
@SamantazFox LGTM. My biggest problem with the current behaviour is that it eats up the space key to play the video, which this PR solves. |
One issue I just discovered with pull #2814 is since the search field is focused when pressing Maybe it could have a little extra logic to disable the key binding when the field is already focused. |
Oh, shoot, I though I fixed it. Thanks for reminding me! (and sorry for the late reply). |
Fixes a side effect of #2814 See: #2791 (comment)
Fixes a side effect of #2814 See: #2791 (comment)
Fixes a side effect of iv-org#2814 See: iv-org#2791 (comment)
Describe the bug
When an invidious page is loaded, with the recent update (afaict), the search text field is auto focused. This means any keys typed are sent to the search field even if the user isn't intending to make a search as their first action.
This has the effect of 'eating' inputs for example of the
space
key for page down (andShift+space
for page up), commonly used by some users like myself in various browsers. Or for playing a video on a video page usingspace
(the prior default behavior).Mightn't be a bug per se but behavior perhaps not considered as a result of a recent change, though the prevention of using
space
on video pages on initial load may be a bug since that seems unintentional. If we compare the behavior to say search engines (eg: duckduckgo.com, bing.com, etc) one can see the search field isn't auto focused so I'm not sure if this new behavior was meant to address something or not (such as a user request).Steps to Reproduce
Screenshots
Additional context
Tested on both Vivaldi (Chromium) and Firefox.
The text was updated successfully, but these errors were encountered: