Expandable Tile: Interaction Constraints #9003
-
Usage questionsI am currently implementing some expandable tiles using the react carbon component library (links to storybook). The design system documentation mentions support for including "CTAs (like links)" in the content area below the fold. This seems a little misleading because the entire Tile component is implemented as a button, which means certain types of CTAs (like buttons) explicitly aren't supported, as button elements should not be nested within other button elements. A specific use case I was looking for was to include filter tags on an expandable tile that could be clicked to remove a given filter from the item represented on the expandable tile. Are my assumptions about CTAs correct here? It may be helpful to update the documentation to clarify these constraints, especially with respect to accessibility. General accessibility concernsThis might be more appropriate as a separate discussion, but in addition to the concern about which elements are semantically appropriate, I am also concerned about how screen readers might interact with static content like lists. In the design system documentation, the expandable example shows a recipe for guacamole, with a semantic layout that guides the user through the steps. When the content is all inside a button, some screen readers (VoiceOver, in particular) will not interpret any of the semantic meaning of the button's inner HTML. For example, list metadata (i.e. "list, 3 items") and arial-labels won't be read by the screen reader, nor will heading levels or other element roles. Instead, the screen reader will read the entire contents of the Button's inner HTML with no pauses or breaks. It also seems that it is not possible to use a mouse to select text in the expandable tiles, both above and below the fold. (I am using MacOS and trackpad, and this is the case in Safari, FF, and Chrome) Related issues and PRs
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
@dbollinger you bring up a very good point about a11y and nesting interactive elements within an interactive element. We have ran into this issue with other components and ended up refactoring. I will bring this up to our designers to see if we want to refactor here or instead update our usage guidelines to follow a11y rules. Thanks for bringing this to our attention! cc: @carbon-design-system/design please read comment above. This is a big issue for a11y. We've fixed issues like this in MultiSelect, Tooltip. Definitely needs to be addressed for expandable tile. Perhaps an alternate design would be to have an expandable button much smaller in the corner (like CodeSnippet, or Accordion), and the rest of the tile isn't actually a button. This would mean the clickable portion wouldn't be the whole tile anymore, but rather just that one area. Otherwise, we should update our usage guidelines to specifically call out that no interactive elements should be nested in here. |
Beta Was this translation helpful? Give feedback.
-
@jnm2377 FYI, I have seen a lot of IBM products adding interactive elements on clickable and selectable (multi select and radio) tiles. Common elements are overflow menu and icon buttons for sure. |
Beta Was this translation helpful? Give feedback.
@dbollinger you bring up a very good point about a11y and nesting interactive elements within an interactive element. We have ran into this issue with other components and ended up refactoring. I will bring this up to our designers to see if we want to refactor here or instead update our usage guidelines to follow a11y rules.
Thanks for bringing this to our attention!
cc: @carbon-design-system/design please read comment above. This is a big issue for a11y. We've fixed issues like this in MultiSelect, Tooltip. Definitely needs to be addressed for expandable tile. Perhaps an alternate design would be to have an expandable button much smaller in the corner (like CodeSnippet, or Accordion), a…