Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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(tree,tree-item): replace checkbox with div and a11y attributes #9849
fix(tree,tree-item): replace checkbox with div and a11y attributes #9849
Changes from 8 commits
8462d8b
6ea4dd3
7bf7434
cda50ab
8bf68f3
3cbb666
e3c3bb0
eee773b
f0053a1
b2643ee
a472f5a
c60efd7
da40476
bd3f229
5fe1cfc
6b69401
d8fda37
ca0770a
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
@driskull Got rid of
tabIndex
in the latest update 🐱💻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.
Does this need a tabindex of 1? Are we ever focusing this element?
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.
It looks like it only gets focused on click, should I remove tabIndex?
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 think so, whats the reasoning for focusing it?
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.
We apply this css block when focusing the checkbox:
.checkbox:focus { @apply outline-none; color: var(--calcite-color-brand); }
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.
But this focus would only happen when clicking on that element.
Could we apply this style to the checkbox when the tree-item host is focused? Then it would be consistent.
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.
Something like
Might also be nice to have on
hover
andactive
as well.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 updated this to apply the focused style when tree-item host is focused.
Regarding the
hover
state, design previously reviewed this and they don't want any styles applied when items are hovered.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 think this one still needs to be addressed.
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.
@aPreciado88 styles look good, but doesn't the
tabindex
of-1
need to be removed?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.
@driskull Design reviewed the latest chromatic builds, and asked to remove the
focused
checkbox state. I pushed an update for that.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.
Just want to confirm aria-checked is ok instead of aria-selected. The treeitem role says either is ok.
https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/treeitem_role
It seems like depending on the selectionMode it should use either aria-checked (multiple) or aria-selected (single)
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.
@aPreciado88 It looks like based on @driskull comment above, there may be a need for both depending on the
selectionMode
type, where only one would be present for theselectionMode
value.