Fix search suggestions not clickable when the press is slow - #1583
Open
thribhuvan003 wants to merge 2 commits into
Open
Fix search suggestions not clickable when the press is slow#1583thribhuvan003 wants to merge 2 commits into
thribhuvan003 wants to merge 2 commits into
Conversation
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.
Fixes #1576.
Clicking a search suggestion does nothing unless the press is quick. Pressing Enter always works, which matches the report.
The input's
onBlurhides the popover 100ms later, and the popover is onlyhidden, not unmounted. Pressing a suggestion blurs the input on mousedown, so a press that lasts longer than 100ms leaves the popoverdisplay: nonebefore mouseup, and no click event ever fires.Preventing the default mousedown inside the popover keeps focus on the input, so it can't hide mid-press. The same
// autofocusstyle inline comment convention already used in this file is kept.Testing
Added a Playwright test that holds the press for 300ms, asserts the popover is still open, and asserts navigation happens. It fails on
main(popover hashidden) and passes with this change.Full suite on Mobile Safari: 63 passed, 1 failed. The failure is
date-time-format.spec.js:176(en-SGlocale combination), which fails the same way with this change stashed, so it looks unrelated to this PR.