feat(search): clear and unfocus input on esc keypress#2423
Open
Cassolette wants to merge 3 commits intoopencloud-eu:mainfrom
Open
feat(search): clear and unfocus input on esc keypress#2423Cassolette wants to merge 3 commits intoopencloud-eu:mainfrom
Cassolette wants to merge 3 commits intoopencloud-eu:mainfrom
Conversation
JammingBen
requested changes
Apr 23, 2026
Comment on lines
+521
to
+522
| const inputElement = this.$el.getElementsByTagName('input')[0] as HTMLElement | ||
| inputElement.blur() |
Member
There was a problem hiding this comment.
I'd rather remove the blur and only keep clearing the term. It feels a bit weird to reset the focus on an input on esc. The blur works for GitHub because the search expands into this "overlay", which we don't have.
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Description
Currently there is no straightforward way to clear the search input. Users have to use traditional means to do so (i.e. select all the text and delete them) which can make file finding by multiple attempts a little troublesome.
To improve search productivity while using keyboard controls, a shortcut keybinding via Esc is introduced to the search bar. While in focus, any search term is cleared when Esc is pressed. Otherwise if there's no search term, the focus on the text input will be rescinded to restore regular operations.
This behaviour is being referenced from GitHub's file finder. OneDrive also has an esc key binding that clears the search input.
Related Issue
How Has This Been Tested?
Types of changes