Skip to content

Fix search suggestions not clickable when the press is slow - #1583

Open
thribhuvan003 wants to merge 2 commits into
cheeaun:mainfrom
thribhuvan003:fix/search-suggestion-slow-press
Open

Fix search suggestions not clickable when the press is slow#1583
thribhuvan003 wants to merge 2 commits into
cheeaun:mainfrom
thribhuvan003:fix/search-suggestion-slow-press

Conversation

@thribhuvan003

Copy link
Copy Markdown

Fixes #1576.

Clicking a search suggestion does nothing unless the press is quick. Pressing Enter always works, which matches the report.

The input's onBlur hides the popover 100ms later, and the popover is only hidden, not unmounted. Pressing a suggestion blurs the input on mousedown, so a press that lasts longer than 100ms leaves the popover display: none before 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 // autofocus style 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 has hidden) and passes with this change.

Full suite on Mobile Safari: 63 passed, 1 failed. The failure is date-time-format.spec.js:176 (en-SG locale combination), which fails the same way with this change stashed, so it looks unrelated to this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

searching for anything only works by pressing the enter key

1 participant