Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the fieldset structure #51510

Merged
merged 1 commit into from
Jan 28, 2025
Merged

Conversation

bl-nero
Copy link
Contributor

@bl-nero bl-nero commented Jan 27, 2025

This PR reverts a change that was implemented during the code review of #51457, because it broke the semantic structure of fieldset and legend. The tests of the follow-up PR #51458 relied on this structure to identify fields by the legend.

This PR is intended to be backported to v17, v16, and v15 manually along with the backports of #51457.

This reverts commit ffe0554.
@bl-nero bl-nero added the no-changelog Indicates that a PR does not require a changelog entry label Jan 27, 2025
@bl-nero bl-nero requested review from ravicious and gzdunek January 27, 2025 18:05
@@ -146,46 +146,42 @@ export function LabelsInput({
const width = `${inputWidth}px`;
const inputSize = 'medium';
return (
<Fieldset gap={labels.length > 0 ? 2 : 1}>
<Stack gap={1}>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was wondering how it broke the semantic structure of fieldset and legend, I managed to find that indeed:

The first element inside the fieldset must be a legend element, which provides a label or description for the group.

https://www.w3.org/TR/WCAG20-TECHS/H71.html

FWIW, I did a quick check and this could also be fixed by getting rid of this Stack and changing the gap on Fieldset to always be 2, with just a minimal difference in spacing compared to the original implementation while keeping spacing defined on parents and not individual children.

@bl-nero bl-nero added this pull request to the merge queue Jan 28, 2025
Merged via the queue into master with commit a9641e6 Jan 28, 2025
43 checks passed
@bl-nero bl-nero deleted the bl-nero/labelsinput-structure-fix branch January 28, 2025 11:13
bl-nero added a commit that referenced this pull request Jan 28, 2025
This reverts commit ffe0554.
bl-nero added a commit that referenced this pull request Jan 28, 2025
This reverts commit ffe0554.
github-merge-queue bot pushed a commit that referenced this pull request Jan 29, 2025
…#51552)

* Support sticky tooltips in FieldInput and legend in LabelsInput (#51457)

* Support sticky tooltips in FieldInput and legend in LabelsInput

* review

* Revert "review" (#51510)

This reverts commit ffe0554.
bl-nero added a commit that referenced this pull request Jan 29, 2025
This reverts commit ffe0554.
github-merge-queue bot pushed a commit that referenced this pull request Jan 29, 2025
…#51556)

* Support sticky tooltips in FieldInput and legend in LabelsInput (#51457)

* Support sticky tooltips in FieldInput and legend in LabelsInput

* review

* Revert "review" (#51510)

This reverts commit ffe0554.
github-merge-queue bot pushed a commit that referenced this pull request Jan 29, 2025
…#51584)

* Support sticky tooltips in FieldInput and legend in LabelsInput (#51457)

* Support sticky tooltips in FieldInput and legend in LabelsInput

* review

* Revert "review" (#51510)

This reverts commit ffe0554.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no-changelog Indicates that a PR does not require a changelog entry size/sm ui
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants