fix: search loses focus when clicking option in top bar quick pick #415
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.
Problem
When users click
@Pin Context
and search for context items and click on an item that has children (like@Files
), the search term remains in the input field and the search input loses focus (see recording). This creates confusion because the displayed results now show the children of the selected item, but the search input still contains the previous search term. Users expect to continue typing to search within the new context, but have to manually click back into the search field.Solution
• Implemented
clearAndFocusFirstTextInput()
method to clear and refocus the search input when navigating to nested items• Added contextSearchPlaceholder configuration option for consistent placeholder text
• Enhanced text input components with clear() and focus() methods for proper state management
• Added comprehensive test coverage for the top bar context menu, including the new search clearing behavior
The search input now maintains focus and clears when an item with children is clicked, allowing users to seamlessly navigate through nested context hierarchies and continue to search without having to manually refocus or clear previous search terms.
Screen recordings
Before fix:
Screen.Recording.2025-07-25.at.3.25.40.PM.mov
After fix:
Screen.Recording.2025-07-25.at.3.26.29.PM.mov
Tests
License
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.