Skip to content

Conversation

@wise-king-sullyman
Copy link
Collaborator

@wise-king-sullyman wise-king-sullyman commented Mar 18, 2022

What: Closes #6798

Additional issues:

(I believe) I've implemented all of Nicole's suggestions from the issue and applied them to the card view demo. If everything looks like it works well enough I'll update the other places Card is being used to the same pattern used here, then convert this to a real PR.

Direct link to the card view demo for convenience: https://patternfly-react-pr-7091.surge.sh/demos/card-view/react-demos/card-view/

@patternfly-build
Copy link
Collaborator

patternfly-build commented Mar 18, 2022

Copy link
Contributor

@thatblindgeye thatblindgeye left a comment

Choose a reason for hiding this comment

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

Looks (and sounds) good! I think the only thing is that the first Card, which is the "add card" one, is being announced as selectable when it actually isn't. Removing the isOption prop from it resolves that, but initially upon entering the listbox there doesn't seem to be any actual context for that Card other than "You are currently on an article."

Using aria-describedby on that card and linking it to its <Title> element kind of works, but still a bit iffy. Going to see if there's anything I could come across tomorrow, or whether anyone else has an idea.

@wise-king-sullyman
Copy link
Collaborator Author

@thatblindgeye looks like having non options in a listbox isn't allowed.

I think either the card-adding card will need to be an option or the actually selectable cards will need to be placed in a separate div to serve as the listbox, and I don't like either of those ideas.

Any thoughts for a better approach than what I've come up with?

@wise-king-sullyman wise-king-sullyman marked this pull request as ready for review March 23, 2022 21:42
@thatblindgeye
Copy link
Contributor

@thatblindgeye looks like having non options in a listbox isn't allowed.

I think either the card-adding card will need to be an option or the actually selectable cards will need to be placed in a separate div to serve as the listbox, and I don't like either of those ideas.

Any thoughts for a better approach than what I've come up with?

The second option is the best of the two, but based on how this demo is meant to be yeah neither option is really ideal.

Depending on the feedback from anyone else, perhaps the best option right now is to have all those cards as isOption, and making a note on the Demo page for it? Overall things work as intended with this one exception, so ultimately I would be okay approving this and having another issue created that could be investigated down the line.

Copy link
Contributor

@nicolethoen nicolethoen left a comment

Choose a reason for hiding this comment

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

I agree with @thatblindgeye
Adding back the option role to the first card is probably the closest we can get it to ideal without more dramatically altering the demo structure - which we'd want to do first in Core i think.
Once that and my note about the example including information about 'listbox', i'll approve.


return (
<React.Fragment>
<div role="listbox" aria-label="Selectable cards">
Copy link
Contributor

Choose a reason for hiding this comment

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

I think that the example should include one sentence above it that describes why you needed to add the role 'listbox' to the div surrounding it.

Copy link
Contributor

@thatblindgeye thatblindgeye left a comment

Choose a reason for hiding this comment

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

Looks good all things considered! Only have a final nitpick but otherwise approved (removed a general comment as I misread and didn't realize this was on the Selectable example rather than the "Card view" Demo)

Comment on lines 71 to 74
Note: The listbox role on the containing div of this examples is needed because the cards have the option role via their `isOption` prop, and options are required to be inside a listbox. See the [option role documentation](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/option_role) from MDN for more information.

The cards need to be options in order to effectively communicate that they're selectable (and what their current selection state is) for those using screen readers.

Copy link
Contributor

@thatblindgeye thatblindgeye Mar 24, 2022

Choose a reason for hiding this comment

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

Nit: The final line could maybe be updated from "for those using screen readers" to "for those using assistive technologies (such as screen readers)." Train of thought is mainly inclusivity.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good callout 🔥

Copy link
Contributor

@jessiehuff jessiehuff left a comment

Choose a reason for hiding this comment

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

This looks pretty good - definitely an improvement! The only odd thing that I noticed is that I'm not sure how to use the kebab anymore inside of the first card with VO. I don't seem to be able to get to it. @thatblindgeye or @nicolethoen can you check to see if you're able to get to that first card's action menu by VO?

@thatblindgeye
Copy link
Contributor

@jessiehuff Hmm yeah I was unable to get to it as well. When VO was active, when I clicked the kebab with my mouse I saw focus briefly on the kebab but then it snapped focus back to the Card itself.

@wise-king-sullyman
Copy link
Collaborator Author

@jessiehuff @thatblindgeye with VO active I can get to the kebab by hitting tab once while focused on a card, is that acceptable?

@thatblindgeye
Copy link
Contributor

One issue with that is whether a user using VO would know there's a kebab to Tab to; if they primarily use the VO + arrow keys to navigate, there may be no indication of a kebab.

That said, I'm wondering if that would be considered a separate issue from this, as per the original issue it does look resolved (as best as can be at this moment), or if the inability to use VO navigation to get to the kebab would block this update.

@wise-king-sullyman
Copy link
Collaborator Author

Closing as it was decided that this would not be the path forward for this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Selectable cards are not announced with screen reader

5 participants