[Select] Fix flaky opening mouseup timing - #49024
Open
michelengelen wants to merge 1 commit into
Open
Conversation
The selected-item timer started inside the unselected timer's callback. The chain compounds setTimeout jitter past the 400ms window. Slow CI runners then miss the window and the WebKit test fails. Start both timers from the mousedown instead. Widen the test sleeps to give the timers real headroom. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013HgD6GEW3UxNRvC2abbTy9
Deploy previewBundle size
Check out the code infra dashboard for more information about this PR. |
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 a flaky WebKit failure in
Select > pointer interactions > closes when the opening mouseup lands on the selected option after the selected-item delay.The problem
SelectInputstarts the selected-item timer inside the unselected timer's callback. The chain runs 200ms + 200ms. EachsetTimeoutadds its own jitter, so the real window drifts past 400ms on a loaded runner. The test slept 450ms, a 50ms margin. WebKit on CI misses that margin, the mouseup arrives whileallowSelectedMouseUpis stillfalse, and the menu never closes.The fix
SELECTED_MOUSE_UP_DELAY). The jitter no longer compounds, and the flat delay matches the existing code comments.Both timers were already cleared together in
clearSelectionTimers, so no cleanup path depended on the nesting.Test plan
pnpm test:browser Select -t "pointer interactions"passes in WebKit and Chromium (22 tests).pnpm test:unit Selectpasses in jsdom (407 tests).🤖 Generated with Claude Code
https://claude.ai/code/session_013HgD6GEW3UxNRvC2abbTy9