-
Notifications
You must be signed in to change notification settings - Fork 897
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
Search input keyboard focus enhancements #4282
Search input keyboard focus enhancements #4282
Conversation
Select text in search input when using Ctrl-L/Meta-L or Alt-D to focus search input Add new Slash key shortcut to focus input without selecting text
Sorry, you're right that my commit still exhibits the issue. It appears that both Chrome and Firefox somehow work around this problem, allowing them to select text without triggering the KDE auto-copy. I have no idea how it's implemented. If it uses some low-level API that's not accessible to Electron I guess we're out of luck. |
(note: the order of the comments is garbled. the above comments were posted during the first DST "repeated hour" for Pacific Time, which seems to have triggered a bug in GitHub's code) |
FreeTube used to have the search focus, but it was removed in #2108 solve #2019, so please don't add it back. The new keyboard shortcut could be considered, but I think it is important to keep in mind that typing the slash character may be easy on a US English keyboard layout, but for many other layouts that is not the case, so maybe a different key would be more suitable. |
After much mucking around, I found a workaround for this behavior in Chromium: make the focus+select asynchronous by wrapping it in a |
Would it make sense to make this an option? I don't think it makes much sense to not implement a feature that's standard in browsers just because it affects what I imagine to be a rather rare desktop environment configuration. Also I think what is being added here is different from what was removed in #2108, as far as I can tell. |
Head branch was pushed to by a user without write access
New auto-select behavior no longer causes #2019 |
@absidue Is there still any desire to merge this? |
I can't get Alt-D to work on MacOS. (I tested my keyboard on https://keyboardchecker.com Oh it seems a different issue Slash & Meta-L work Update 1:
Just ignore Alt-anything on MacOS |
Thanks for taking the initiative on this @sporeventexplosion! Works great for Ctrl+L and Alt+D. One main issue I'm seeing: pressing |
Agree on removing slash as short cut, I can't type |
I agree, that should be separated from this PR. |
Head branch was pushed to by a user without write access
Head branch was pushed to by a user without write access
62bd095
to
33554b5
Compare
Slash shortcut has been removed |
isFocused() { | ||
return document.activeElement === this.$refs.input | ||
}, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like this code is now unused.
isFocused() { | |
return document.activeElement === this.$refs.input | |
}, |
Head branch was pushed to by a user without write access
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
* development: Translated using Weblate (Lithuanian) Work around context menus in the devtools being displayed behind the window (FreeTubeApp#4264) Search input keyboard focus enhancements (FreeTubeApp#4282) Translated using Weblate (Turkish)
Search input keyboard focus enhancements
Pull Request Type
Related issue
Partially implements a feature requested in #2138
Description
Select text in search input when using Ctrl-L/Meta-L or Alt-D to focus search input.
This is the behavior of the combined address/search box of both Chrome and Firefox. I think it makes sense here because the search input in the application is essentially both an address box and a search box.
Add new Slash key shortcut to focus input without selecting text.
This does not select the text in the input, which matches the behavior of the YouTube web frontend.
Screenshots
Testing
Desktop
Additional context