Repository navigation
fix(demo): give focus back to the button that opened the sheet or shortcuts in Safari - #329
Merged
Merged
Conversation
… into view The keyboard drop test focused the "Call the dentist" card and pressed Space at once. The card sticks out 18 px below the sidebar, and WebKit scrolls a focused element into view on a later frame, not in focus(). When Space came first, the drag started from the card's old centre, below the time grid's hours, and the drop landed nowhere. It failed in Linux WebKit about once in four runs of the file, at any time of day. The test now waits for the card to show within the sidebar before picking it up, and for the drop preview before dropping. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rtcuts in Safari WebKit, like Safari, doesn't focus a button it clicks. The Solid and StyleX pages open the sidebar's sheet and the shortcuts dialog from state, with no dialog trigger, so on close ui-sdk's dialog returned focus to what had it before they opened: the page. The Tailwind page kept it, because Base UI's button focuses itself on press. The top bars now pass the button pressed, and the sheet and the dialog take it as finalFocus. The "?" key still opens the shortcuts with the default. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ari does The new focus checks passed without the fix in Chromium and in WebKit on Linux, which focus a clicked button, so only macOS WebKit tested it. A press now leaves focus where it was in every engine. Also from the review: ui-sdk already skips a final focus target that's gone, so the demos pass the opener as it is. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Owner
Author
|
Local gate on 7a0d402 (macOS):
Dispatched CI on this branch for the release gate: run 45731703066, https://github.com/Moltenship/time/actions/runs/45731703066 (in progress when posted). |
Owner
Author
|
Merging. On 7a0d402 the PR check (run 45731693392) is green. The dispatched release gate (run 45731703066) passed everything this PR touches in Linux WebKit: 564 of 565 tests in |
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.
Two WebKit failures in the Solid demo's checks (
tools/a11y/tests/solid/demo.a11y.tsx) blocked the release gate'sbrowsersstep. They have different causes.1. The keyboard drop, in Linux WebKit: a test artefact, not the clock
"a task picked up with Space drops onto the week as an event" failed in the release gate (runs 45722903475 and 45726058412) with "expected null not to be null".
Not the clock. In a Linux WebKit container (Playwright's image, TZ=UTC) the drop failed:
Temporal.Nowfrozen at 10:30;When it failed, every key arrived and the drag's
drop()ran, but it proposed nothing.The cause.
card.focus()scrolls the sidebar.focus(), as the HTML spec has it. WebKit scrolls on a later frame, about 35 ms afterfocus()in the probe. The sidebar'sscrollTopwas still 0 after a microtask and after the next animation frame.A person can't press Space within a frame of tabbing to the card, so the demo is fine. The test now:
2. The sidebar's sheet, in macOS WebKit: a demo bug, on the StyleX page too
"the sidebar's sheet" failed every time in macOS WebKit: after Escape, focus was on
<body>, not on "Open sidebar".The cause.
A Safari user who opened the sheet or the shortcuts with a click, then pressed Escape, lost their place.
The fix.
finalFocus.aria-expandedandaria-haspopupon two of the three pages, a difference the parity test would report.The tests.
tools/a11y/tests/clicks.ts), as Safari does, so Chromium in the PR gate checks the fix too.demo-stylex.a11y.tsxchecks both buttons.Screenshots
The Solid demo on a phone in macOS WebKit, after "Open sidebar" is clicked and the sheet is closed with Escape. After the fix, the menu button keeps focus, with its ring; before, focus is on the page.
Checks
vp run ready: green on 7a0d402, "ready: every PR check passed", 34/34 tasks, exit 0. Also green on 022ccc0, before the review's fixesvp run browsers(macOS): green on 7a0d402, 41 files and 565 tests passed, exit 0. Also green on 022ccc0release-gatejob, dispatched on this branch: see the comment belowReview
One round by Claude Opus 5.5 (high). No blockers.
connectedhelpers add nothingsetTheme("light")adds nothing to the StyleX check🤖 Generated with Claude Code