Link control: Cancel and Save buttons visual order and DOM order mismatch #56039
Labels
[Feature] Link Editing
Link components (LinkControl, URLInput) and integrations (RichText link formatting)
[Focus] Accessibility (a11y)
Changes that impact accessibility and need corresponding review (e.g. markup changes).
[Package] Block editor
/packages/block-editor
[Status] In Progress
Tracking issues with work in progress
[Type] Bug
An existing feature does not function as intended
Description
The link control UI provides two buttons: Cancel and Save.
These buttons visual order mismatches the DOM order. For accessibility, visual order and DOM order must always match.
There may be exceptions for decorative elements that don't impact meaning and operability but, in general, the usage of CSS properties that alter the visual order like all the flex / grid
*-reverse
andorder
properties should never be used.Introeuced in #46933. Quoting the test instructions from that PR:
It appears the altered order was intentional. However, this is an accessibility barriere and an explicit WCAG violation. It's important to make all designers and developers aware that visual order and DOM order must always match.
As far as I can tell, the link control is used in the link inline UI and also in the media replace flow UI. Screenshots:
Aside: notice the media replace popover has some extra, inconsistent, padding around the buttons.
Step-by-step reproduction instructions
Screenshots, screen recording, code snippet
No response
Environment info
No response
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Yes
The text was updated successfully, but these errors were encountered: