Open
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
punitarani
added a commit
that referenced
this pull request
Oct 10, 2025
The clear filters button was triggering the airline dropdown to open
because handleAirlineClearSearch() focuses the input field, which in
turn triggers the onFocus handler that opens the dropdown.
Changed handleResetAllFilters to directly call setAirlineSearch("")
instead of handleAirlineClearSearch(), avoiding the unwanted focus
behavior while still clearing the search text.
Fixes the issue reported in PR #22.
punitarani
added a commit
that referenced
this pull request
Oct 10, 2025
Root cause: The Command component's onFocus handler opens the dropdown
whenever any element inside gets focus. Even though the previous fix
removed the explicit focus() call, React state updates and event
handling could still cause the dropdown to open during the reset.
Solution: Explicitly close the dropdown by calling
setIsAirlinePickerOpen(false) at the start of handleResetAllFilters.
This ensures the dropdown stays closed regardless of any subsequent
focus events or state updates during the reset process.
Also changed to call setAirlineSearch("") directly instead of
handleAirlineClearSearch() to avoid the focus() side effect.
Fixes the issue reported in PR #22.
punitarani
added a commit
that referenced
this pull request
Oct 11, 2025
Root cause: When the Clear Filters button is clicked and filters are reset,
the button becomes disabled (because canClearFilters becomes false). The
browser then automatically shifts focus to the next focusable element, which
can be the Command input, triggering the onFocus handler that opens the
dropdown.
Solution:
1. Add isResettingRef flag to track when a reset is in progress
2. Modify handleAirlineFocus to check !isResettingRef.current before opening
3. In handleResetAllFilters:
- Set isResettingRef.current = true
- Close dropdown with setIsAirlinePickerOpen(false)
- Blur the input with commandInputRef.current?.blur()
- Call onReset() and setAirlineSearch("")
- Clear flag after 100ms timeout to allow focus events to settle
This prevents the focus handler from reopening the dropdown during the
reset process, regardless of browser focus management or React state
batching.
Fixes the issue reported in PR #22.
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.
No description provided.