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

blob: Always select search input value when pressing Mod-f #55546

Merged
merged 2 commits into from Aug 7, 2023

Conversation

fkling
Copy link
Contributor

@fkling fkling commented Aug 3, 2023

Resolves #54810

Browsers' built-in search input will select the input value when pressing Mod-f, even when the focus is already on the search input.

The default CodeMirror behavior will only select the input value when the input is not already focused. This PR changes the behavior to match the browser's behavior.

Test plan

  • Open file page
  • Press Mod-f to open file search
  • Type any input value
  • Press Mod-f again -> input value is selected

@cla-bot cla-bot bot added the cla-signed label Aug 3, 2023
@fkling fkling added team/code-search Issues owned by the code search team and removed cla-signed labels Aug 3, 2023
@cla-bot cla-bot bot added the cla-signed label Aug 3, 2023
Browers' built-in search input will select the input value when pressing
Mod-f, even when the focus is already on the search input.

The default CodeMirror behavior will only select the input value when
the input is not already focused. This PR changes the behavior to match
the browser's behavior.
@fkling fkling force-pushed the fkling/54810-file-search-select branch from be44f60 to 9a3c8c5 Compare August 3, 2023 12:06
@fkling fkling requested a review from a team August 3, 2023 12:08
@sourcegraph-bot
Copy link
Contributor

📖 Storybook live preview

@fkling fkling merged commit 633ed62 into main Aug 7, 2023
24 checks passed
@fkling fkling deleted the fkling/54810-file-search-select branch August 7, 2023 09:40
davejrt pushed a commit that referenced this pull request Aug 9, 2023
Resolves #54810

Browsers' built-in search input will select the input value when
pressing Mod-f, even when the focus is already on the search input.

The default CodeMirror behavior will only select the input value when
the input is not already focused. This PR changes the behavior to match
the browser's behavior.



## Test plan

- Open file page
- Press `Mod-f` to open file search
- Type any input value
- Press `Mod-f` again -> input value is selected
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed team/code-search Issues owned by the code search team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cmd-F should highlight the search text in the search box if I press Cmd-F while focusing the search box
3 participants