Skip to content
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

Auto select all text when search bar is focused #4747

Closed
wants to merge 3 commits into from
Closed

Auto select all text when search bar is focused #4747

wants to merge 3 commits into from

Conversation

9mdv
Copy link

@9mdv 9mdv commented Mar 5, 2024

Auto select all text when search bar is focused and implement Ctrl+U keyboard shortcut.

Pull Request Type

  • Feature Implementation

Related issue

Closes #4746 and somewhat related to #4247

Description

This is my attempt at implementing the auto select feature. When focusing the search bar via Ctrl+L, it will auto select all text for easy deletion. The Ctrl+U is a convenience shortcut that will clear all the text inside the search bar which is pretty standard on all HTML input textbox as well as on YouTube itself.

Desktop

  • OS: Linux
  • OS Version: 6.6.20 LTS
  • FreeTube version: 0.19.2

@FreeTubeBot FreeTubeBot enabled auto-merge (squash) March 5, 2024 23:45
@github-actions github-actions bot added the PR: waiting for review For PRs that are complete, tested, and ready for review label Mar 5, 2024
@9mdv 9mdv marked this pull request as draft March 5, 2024 23:47
auto-merge was automatically disabled March 5, 2024 23:47

Pull request was converted to draft

@github-actions github-actions bot removed the PR: waiting for review For PRs that are complete, tested, and ready for review label Mar 5, 2024
@9mdv 9mdv marked this pull request as ready for review March 5, 2024 23:47
@github-actions github-actions bot added the PR: waiting for review For PRs that are complete, tested, and ready for review label Mar 5, 2024
@FreeTubeBot FreeTubeBot enabled auto-merge (squash) March 5, 2024 23:48
@absidue
Copy link
Member

absidue commented Mar 6, 2024

I suspect that CTRL+U selecting text in web browsers is a Linux specific thing, as using that combination in any web browser on Windows views the source code.
Therefore it might make sense to only have that shortcut work on Linux if at all.

This pull request will also reintroduce problems for your fellow Linux users, as selecting text causes Linux to copy it for some people.

auto-merge was automatically disabled March 7, 2024 06:39

Head branch was pushed to by a user without write access

@FreeTubeBot FreeTubeBot enabled auto-merge (squash) March 7, 2024 06:40
@9mdv
Copy link
Author

9mdv commented Mar 7, 2024

I suspect that CTRL+U selecting text in web browsers is a Linux specific thing, as using that combination in any web browser on Windows views the source code. Therefore it might make sense to only have that shortcut work on Linux if at all.

Ctrl+u is for clearing the text inside the search box and will only trigger there, so not really a global shortcut. With this enabled, it would be easier to use with a keyboard: Ctrl+L to focus the search box -> Ctrl+u to clear the old text -> Ctrl+v to paste the new text or link.

This pull request will also reintroduce problems for your fellow Linux users, as selecting text causes Linux to copy it for some people.

You're right, this will probably pollute some people's clipboard if their system is set to copy the primary selection. Probably better to put it behind a setting, via a toggle.

@9mdv
Copy link
Author

9mdv commented Mar 28, 2024

Closing this PR as I've found an alternative with the same 3 keystrokes: Ctrl+L A V.

@9mdv 9mdv closed this Mar 28, 2024
auto-merge was automatically disabled March 28, 2024 06:36

Pull request was closed

@github-actions github-actions bot removed the PR: waiting for review For PRs that are complete, tested, and ready for review label Mar 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature Request]: Select all text when focusing the search bar
3 participants