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

Only handle "Select All" when Term has focus #7736

Open
wants to merge 1 commit into
base: canary
Choose a base branch
from

Conversation

JJJ
Copy link

@JJJ JJJ commented Jan 21, 2024

Fixes #6733.

@JJJ
Copy link
Author

JJJ commented Jan 21, 2024

I purposely am opting to use vanilla JS here (instead of internal Hyper/React properties) with future-proofing in mind.

I originally started trying to stop this from inside of the SearchBox component, but the only approach I could think of was more invasive (importing Hyper/Term) while also only targeting keydown on the SearchBox input.

Doing this from inside the Hyper container ensures that if some other input (say, that a plugin might introduce) has focus, the "Select All" attempt will not be handled then either.


Another search-specific code change could be:

    if (term && !term.props.search) {
      term.selectAll();
    }

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.

Select All operation is not possible in the search bar
1 participant