Skip to content

[EuiKeyboardAccessible] Discuss deprecation #3838

Closed

Description

@myasonik

I'd like to deprecate and remove EuiKeyboardAccessible.

From the docs:

You can make interactive elements keyboard-accessible with the EuiKeyboardAccessible component. This is necessary for non-button elements and a tags without href attributes.

But that doesn't seem to hold up because:

  1. All interactive elements should either be a native HTML element (e.g., button, anchor, label) or are more complex components (e.g., tabs, typeaheads) that require a lot more work than what EuiKeyboardAccessible does or even could reasonably do
  2. The example here of anchors without href attributes shouldn't be interactive so I wouldn't recommend using it like that

And, taking a look at Kibana as an example, there are 5 uses of it today:

  • 2 are being used on divs that should probably be converted to native button elements
  • 1 is being used as some super janky focus control and doesn't do anything and should probably just be removed
  • 1 is wrapping a div which wraps a button element... so, I guess should probably be removed?
  • 1 is wrapping an anchor so should probably be removed

So, at least in Kibana, there seems to be a lot of misuse of it already.

Activity

  1. thompsongl commented on Jul 31, 2020

    @thompsongl
    Contributor

    There are only two components in EUI that use it (EuiBasicTable and EuiStepHorizontal; one usage each). I'm guessing both instances could benefit from a more tailored approach like mentioned above.

  2. cchaos commented on Aug 3, 2020

    @cchaos
    Contributor

    Don't forget, however, to not just check for usages of the component <EuiScreenReaderOnly> but we also use the class .euiScreenReadOnly and the SASS mixin euiScreenReaderOnly(). I would suggest auditing the usage of those as well.

  3. myasonik commented on Aug 3, 2020

    @myasonik
    ContributorAuthor

    @cchaos I'm only suggesting removing EuiKeyboardAccessible, I'm not suggesting touching EuiScreenReaderOnly at all.

    I double checked and it doesn't seem like EuiKeyboardAccessible has any associated styles but if you know of any, point me in the direction and I'll check Kibana for it.

  4. cchaos commented on Aug 4, 2020

    @cchaos
    Contributor

    Gah! I so did not read that correctly at all. Sorry... I'm good with deprecating it. Probably just throw a "Set for deprecation" label up on it, and let's add it to the next (Dec. 2020) deprecation cycle #1469

  5. myasonik commented on Aug 4, 2020

    @myasonik
    ContributorAuthor

    Should we remove it from the docs?

  6. cchaos commented on Aug 4, 2020

    @cchaos
    Contributor

    No, just setup a label like we have for EuiNavDrawer.

  7. changed the title [-][Discuss] Deprecate [EuiKeyboardAccessible][/-] [+][EuiKeyboardAccessible] Discuss deprecation[/+] on Sep 20, 2020
  8. myasonik commented on Oct 14, 2020

    @myasonik
    ContributorAuthor

    So I started taking a look at removing EuiKeyboardAccessible I don't know how to proceed with EuiBasicTable.

    It uses EuiKeyboardAccessible on a table row which gives it a role=button and assigns a click event to that which isn't something screen readers can really handle...

    The best way to make a clickable table row accessible is to delegate click events on the row onto a visible button but that would be a pretty big breaking change. Is that something we can roll out somehow? (Slowly?)

  9. snide commented on Oct 14, 2020

    @snide
    Contributor

    @myasonik It might be a good idea to just remove EuiKeyboardAccessible and move it's functionality into EuiBasicTable in that one spot. That way at least the component itself doesn't spread. We can target the table issue in a later PR. Off hand, the role=button in that case seems needed. It seems more a limitation of HTML table structures versus the reality of need (clickable rows).

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions