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
Description
Tab index of -1 causes a focus outline when clicked.
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 :)