Skip to content
This repository was archived by the owner on Jan 14, 2025. It is now read-only.
This repository was archived by the owner on Jan 14, 2025. It is now read-only.

ListItemGraphic, ListItemText, ListItemMeta have tabIndex -1 by default #1008

Closed as not planned
@liamcmitchell-sc

Description

@liamcmitchell-sc

Tab index of -1 causes a focus outline when clicked.

Screenshot 2019-10-24 at 11 35 54

I don't think this should be the default behavior. Is there a reason for this?

I see discussion here explaining that some elements need to toggle between 0 and -1: #339 (comment)

But giving non-interactive elements -1 doesn't make sense.

The workaround I am using is to pass an empty string. This works the same as undefined but avoids -1 being set:

<ListItemText
  tabIndex=""
  // tabIndex={('' as any) as undefined} // if you are using TypeScript
  primaryText="Primary"
/>

I can make a PR if anyone will look at it :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Unresolved (Archived)Open and unresolved issues and PRs that were closed due to archiving the repository.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions