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

Treegrid example should use the hidden attribute rather than a hidden class #2881

Closed
jcoyne opened this issue Dec 6, 2023 · 2 comments
Closed
Labels
question Issue asking a question

Comments

@jcoyne
Copy link

jcoyne commented Dec 6, 2023

The hidden attribute is more semantically meaningful and would make the code less complex:
https://github.com/w3c/aria-practices/blob/main/content/patterns/treegrid/examples/js/treegrid-1.js#L351-L354

I've written the issue title as a statement, but it's actually a bit of a question. Is my assertion correct? My supposition is that when this was written 5 years ago, the hidden attribute was not as widely supported as it is now. Can or should the example be updated to use the hidden attribute?

@mcking65 mcking65 added the question Issue asking a question label Dec 12, 2023
@css-meeting-bot
Copy link
Member

The ARIA Authoring Practices (APG) Task Force just discussed Issue 2881 - Should there be preference for using hidden attribute?.

The full IRC log of that discussion <jugglinmike> Topic: Issue 2881 - Should there be preference for using hidden attribute?
<jugglinmike> github: https://github.com//issues/2881
<jugglinmike> Matt_King: Looking at the code for Tree Grid, we're hiding and unhiding using CSS
<jugglinmike> Matt_King: This person is asking, "wouldn't the code be more clear if it used the 'hidden' attribute instead?"
<jugglinmike> jongund: I don't think it makes a difference; just a different coding style
<jugglinmike> jugglinmike: Using the "hidden" HTML attribute is less ambiguous, and I would prefer it, but I think a CSS class name like "hidden" is relatively descriptive
<jugglinmike> CoryJoseph: I feel the same

@mcking65
Copy link
Contributor

Based on discussion in today's meeting, the task force believes code can be equally clear regardless of whether the HTML hidden attribute or CSS is used. Obviously, class name affects clarity.

While sometimes influenced by external factors, this choice is largely stylistic, and the task force doesn't have a case for modifying the treegrid examples, the other examples, or the APG code guide.

@jcoyne, please feel free to re-open this issue if you would like to continue the discussion by sharing reasons that support task force adoption of a different path.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Issue asking a question
Projects
None yet
Development

No branches or pull requests

3 participants