-
-
Notifications
You must be signed in to change notification settings - Fork 31.1k
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
Fixed #35189 -- Render admin collapsible fieldsets with <details>. #17910
Conversation
|
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
627eb66
to
ffb0a66
Compare
This comment was marked as resolved.
This comment was marked as resolved.
Hi @MHLut I think this looks really promising thank you ⭐ I can see on your PR that in RTL we have this (notice that 'Collapsible' is on the left) Previously 'Collapsible' was on the right: I am also not sure if the collapse icon (> triangle thingy) should be on the left, so before Fields in the right to left case (maybe @sakhawy might be able to tell us 🙏 ) You might need to look into |
(on further thought, I think the triangle is in the correct place for RTL languages but Moe is welcome to confirm) |
@sarahboyce I guess it "feels off" because we're used to seeing dropdowns with the triangle after the text and not before it :D One reason for checking the
I think it's the reason 'Collapsible' is on the left when |
69349a0
to
81f1b78
Compare
@sarahboyce @sakhawy Thanks for the heads-up. I can't remember why I put the The triangle is—as Moe mentioned—part of FYI: I'm currently doing some free-form CSS experiments for forced-colors mode. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't look much at the code, or look at it on a screen.
From an accessibility standpoint I think we're good with this approach. The outline seems a little odd still (that there are multiple h3s per link, rather than one h3 and then going to h4 or something similar) but I think this is better than what we currently have and shouldn't block this merge - to be honest I'm not even sure if it's a problem at all, I could be totally wrong.
If I find time before someone else I will also review the code.
@nessita The tests finally seem to pass, so that you can return to testing and reviewing! I don't have much time for follow-ups, but I would like to see this merged before the feature freeze, so feel free to update the branch as you see fit. @sakhawy might also be able to assist with issues that don't require knowing the entire PR history. |
Thank you so much @MHLut, I'll work in this PR tomorrow or Thu at the latest. |
@MHLut Hey there! I have pushed some changes removing the definition and usage of @sarahboyce Would you fancy to re-review that commit (it's isolated in a second commit to ease review)? (Since I changed some of the already approved code.) FYI I still need to review in detail tests and docs, but overall I think the branch is in very good shape. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't do a full review since the change of approach. 👍
This generally looks good, we're missing tests checking the logic that exists in the templates
@nessita @sarahboyce Thank you for the heading ID update! I cannot review the ID changes in detail right now, but the only thing important to me is that they are predictable and unique since A nice to have for IDs would be for them to be short and readable so that they are understandable when read from a browser URL. |
f453954
to
fc3eb2c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
If we want to split commits I would have:
- setting the header levels and adding the
aria-labelledby
as "Associated fieldsets with their headers." - updating collapse to use details/summary
This is a good proposal, thank you! I will try to work this out after our weekly sync. |
fa11f6f
to
e00ca8d
Compare
…a-labelledby. Before this change, HTML <fieldset> elements in the admin site did not have an associated label to describe them. This commit defines a unique HTML id for the heading labeling a fieldset, and sets its aria-labelledby property to link the heading with the fieldset.
I split the first commit into two logical commits. |
…s> elements. This work improves the accessibility of the add and change pages in the admin site by adding <details> and <summary> elements to the collapsible fieldsets. This has the nice side effect of no longer requiring custom JavaScript helpers to implement the fieldsets' show/hide capabilities. Thanks to James Scholes for the accessibility advice, and to Sarah Boyce and Tom Carrick for reviews. Co-authored-by: Natalia <124304+nessita@users.noreply.github.com> Co-authored-by: Sarah Boyce <42296566+sarahboyce@users.noreply.github.com>
TL;DR: Improve the accessibility of admin fieldsets and collapse them with a native HTML implementation.
Related tickets and PRs
Related items:
Important facts
Known issues
forced-colors
mode..collapse. h3
informs.css
was copied from.module h2, .module caption, .inline-group h2
inbase.css
.Note: Several CSS fixes that we could make would cause scope creep beyond the collapsible fieldsets, so I recommend fixing them in separate PRs.