Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
liamcmitchell-sc opened this issue Oct 24, 2019 · 0 comments

Comments

@liamcmitchell-sc
Copy link
Contributor

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 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant