Repository navigation
fix(feedback): Improve dialog keyboard access and input contrast - #26461
sentry-junior[bot] wants to merge 13 commits into
Conversation
Co-Authored-By: Martin Sonnberger <26038247+msonnb@users.noreply.github.com>
Preact's useId restarts for every render() root, so every dialog in the shared shadow root got the same id and aria-labelledby resolved to the first dialog's title. Co-Authored-By: Martin Sonnberger <26038247+msonnb@users.noreply.github.com>
showModal() throws in iframes sandboxed without allow-modals. The exception escaped the layout effect and left the widget unable to open again. Also focus the autofocus control explicitly, since WebKit did not move focus there in CI. Co-Authored-By: Martin Sonnberger <26038247+msonnb@users.noreply.github.com>
On a successful submit the dialog closed through close(), which moved focus to the still-hidden launcher while the success message showed, and the later close() could pull focus away from wherever the user had moved it. Hide the dialog without restoring focus on submit, and only restore focus when it has not moved elsewhere. Co-Authored-By: Martin Sonnberger <26038247+msonnb@users.noreply.github.com>
size-limit report 📦Compared: f30f085 (PR test merge using develop at 8c8f0d4) Against: 13f8b42 (develop) · base run #66477
|
|
One or more gzipped bundles increased by more than 500 bytes. If this increase is intentional, add the Accept Bundlesize Increase label to this PR to rerun and accept the check. |
Optional E2E testsSome optional checks were not successful. They do not block the merge. 2 not successful, 61 successful. See the run.
Successful checks
|
The dialog element called the modal integration's onFormClose, which closes the dialog and then calls the core wrapper that closes it again. Call options.onFormClose directly, as before this change.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 3 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 9e95c24. Configure here.
showModal() already makes the rest of the page inert, so a manual Tab trap is not needed.
Gives the same accessible name without a generated title id. Co-Authored-By: Martin Sonnberger <26038247+msonnb@users.noreply.github.com>
…ialogs Cancelling the Escape keydown stops the native cancel event, so the dialog closes once. onCancel stays for other close requests, such as the Android back button. Co-Authored-By: Martin Sonnberger <26038247+msonnb@users.noreply.github.com>
Co-Authored-By: Martin Sonnberger <26038247+msonnb@users.noreply.github.com>

Adopts #26194 by @david-kirkland. Their commits are kept in this branch.
What
The feedback dialog now opens as a native modal (
showModal()), so the rest of the page is inert. It gets an accessible name from the form title, closes on Escape, and returns focus to the launcher. Input borders get a stronger default color that meets 3:1 non-text contrast in light and dark mode.On top of the original change:
showModal()throws, such as in an iframe sandboxed withoutallow-modals, the dialog falls back to a non-modal one instead of leaving the widget unable to open again. Theautofocuscontrol is also focused explicitly, since WebKit does not always move focus there.aria-labelreplaces a generated title id, and Escape is handled in one place.Why
WCAG 2.2 4.1.2 (Name, Role, Value), 2.4.3 (Focus Order), and 1.4.11 (Non-text Contrast).
Closes: #26081
via @msonnb.
--
View Session [Sentry]