Skip to content

InfoTooltip is not keyboard reachable and has no accessible name #1829

Description

@jijillery

InfoTooltip renders its icon in a plain <div>:

https://github.com/layer5io/sistent/blob/master/src/custom/CustomTooltip/infoTooltip.tsx

<CustomTooltip title={helpText} {...props}>
  <div style={{ display: 'flex', ... }}>
    <InfoOutlinedIcon {...iconSmall} />
  </div>
</CustomTooltip>

That element has no accessible name, no role, and no tab index, so the help
text it carries is unreachable for a keyboard or screen-reader user:

  • nothing announces it in browse mode - the icon is decorative markup;
  • it cannot be focused, and MUI opens a tooltip on focus, so the text has no
    keyboard route at all;
  • CustomTooltip hands MUI a ReactNode title, and MUI's Tooltip only sets
    aria-label from a title when that title is a string (titleIsString ? title : null), so the closed tooltip contributes no name either.

Why it matters here

meshery-cloud renders a per-field information affordance on every schema-driven
form (the field's description from meshery/schemas). InfoTooltip is
exactly the component for that job, but it cannot be used: our accessibility
requirement is that the affordance is reachable and announced. We hand-assemble
CustomTooltip + IconButton component="span" + an aria-label instead, which
is duplicated design-system markup living in a consumer.

Suggested fix

Render the icon in a ButtonBase/IconButton (component="span" keeps it
legal inside a <label>-adjacent layout) rather than a <div>, and accept an
aria-label - defaulting to the helpText when it is a string - so the
component names itself. That keeps every existing call site working and makes
the affordance reachable by Tab, which also opens the tooltip.

Happy to raise the PR if the shape above looks right.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions