这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@darrylblake
Copy link
Contributor

This is to solve an issue with React, if the classes are updated on render the focus-visible class is removed as React is unaware of it. This could happen when the element should still be focused, one example being a switch component that's toggled with the keyboard updating the classes.

if (e.target.classList.contains('focus-visible')) {
if (
e.target.classList.contains('focus-visible') ||
el.hasAttribute('data-focus-visible-added')
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't look like el is in scope here. Did you mean e.target?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did indeed! Sorry copypasta... fixed.

@robdodson
Copy link
Collaborator

looks good to me. I can merge once travis gets back to us :)

@darrylblake
Copy link
Contributor Author

Great thanks! :)

@robdodson robdodson merged commit 2f53ac8 into WICG:master May 16, 2018
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

Successfully merging this pull request may close these issues.

2 participants