Repository navigation
fix(web): a dismissed folder picker stays closed when its label forwards the click - #460
Merged
Merged
Conversation
…rds the click Clicking the field's "Working directory" label closed the open panel on the outside pointerdown, and the browser's label activation then dispatched the same gesture's click on the input, which still held focus, reopening it. A dismiss now arms a flag that the next gesture's capture-phase pointerdown clears; a click-driven open that arrives while it is armed is the tail of the dismissing gesture and drops.
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
The bug
Clicking the field's Working directory label while the folder picker was open closed the panel and bounced it right back. One label click is two events: the outside
pointerdowndismisses the panel, and the browser's label activation then dispatches the same gesture'sclickon the input — which still holds focus and fires no focus event of its own — and the input'sonClick={openPicker}reopened it.The fix
An outside-pointerdown dismissal arms a flag; every new gesture's capture-phase
pointerdownclears it (spec-anchored ahead of the dismiss handler on the same event), and a click-driven open arriving while armed is the tail of the dismissing gesture and drops. Focus-driven opens are untouched: Tab-in and a label click onto an unfocused field still open the picker.Verified
@internal/server-websuite 3054/3054; tsc and biome clean.