-
Notifications
You must be signed in to change notification settings - Fork 23
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
Add feature: Heading Nodes vs textContent #10
Comments
Agree, that is useful and something I was going to tackle as part of #9 However, I'd be happy to accept a PR if you'd like to submit one per these changes :) |
I'll see what I can do. |
Will use that patch for now. Would be happy to see this in a future release! |
I had to add this code to the toggle function, so that arias get correctly updated:
|
assuming your comment is in reference to the patch, @krokodok ? |
Yes, I used @danjacquemin 's code. |
Sorry guys, this feature is very useful but sketchy regarding heading contents. According to W3C specifications for the Therefore, to remain compliant with the W3C specifications you need to check if heading contents are not block-level elements before injecting them as |
headings and buttons both have a content model that allows for phrasing content as child elements, so your note to be cautious about this is appropriate, but not necessarily for the reason you state. what would be more concerning is if authors had headings containing interactive elements and those were then attempted to be injected into a button. tbh, i think the script needs to go in a different direction on this / among a few other areas. Not going to close this issue or the linked PR, in case anyone else wants to do something similar. but also not moving forward on this anytime soon either. |
The |
a as i already stated, buttons and headings both allow for phrasing content as expected child elements. buttons have additional restrictions of disallowing interactive elements or elements with tabindex=0 on them. Phrasing elements are listed here: that said, the usefulness of injecting elements beyond the ability for people to include icons within their accordion trigger buttons is negligible since button elements are meant to treat child nodes as presentational. |
Sorry... my mistake about That said, common people don't know about HTML specifications. The active PR don't care about that and injects blindly. I just wanted to draw your attention about W3C standards ... But I'm sure that it will be the case for the next releases ;) |
thank you. i literally laughed out loud at this. |
Ran into an issue where I needed some
SPAN
content passed thru to the button text. Ex: a FontAwesomeI
tag.In your
ARIAaccordion.setupHeadingButton
function the following changes did the trick.So, there ya go.
It might be something useful.
Share and enjoy.
dhj
The text was updated successfully, but these errors were encountered: