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

:focus-visible is set when I click in a sub element in label #5685

Open
Lookwe69 opened this issue Jul 24, 2024 · 1 comment
Open

:focus-visible is set when I click in a sub element in label #5685

Lookwe69 opened this issue Jul 24, 2024 · 1 comment

Comments

@Lookwe69
Copy link

What is affected?

Accessibility, Component

Description

When I click in a sub element in label to focus the checkbox, the checkbox is focused with :focus-visible state. I expected it to be focused without this state (like when we click directly on the label).

Reproduction

The checkbox must not have :focus-visible state when we click on the red span.
https://lit.dev/playground/#project=W3sibmFtZSI6InNpbXBsZS1ncmVldGluZy50cyIsImNvbnRlbnQiOiJpbXBvcnQge2h0bWwsIGNzcywgTGl0RWxlbWVudH0gZnJvbSAnbGl0JztcbmltcG9ydCB7Y3VzdG9tRWxlbWVudCwgcHJvcGVydHl9IGZyb20gJ2xpdC9kZWNvcmF0b3JzLmpzJztcbmltcG9ydCAnQG1hdGVyaWFsL3dlYi90ZXh0ZmllbGQvZmlsbGVkLXRleHQtZmllbGQuanMnO1xuaW1wb3J0ICdAbWF0ZXJpYWwvd2ViL2NoZWNrYm94L2NoZWNrYm94LmpzJztcblxuQGN1c3RvbUVsZW1lbnQoJ3NpbXBsZS1ncmVldGluZycpXG5leHBvcnQgY2xhc3MgU2ltcGxlR3JlZXRpbmcgZXh0ZW5kcyBMaXRFbGVtZW50IHtcbiAgc3RhdGljIHN0eWxlcyA9IGNzc2BcbiAgICAgIHNwYW4ge1xuICAgICAgICBiYWNrZ3JvdW5kLWNvbG9yOiByZWQ7XG4gICAgICB9XG4gIGA7XG4gIFxuICByZW5kZXIoKSB7XG4gICAgcmV0dXJuIGh0bWxgXG4gICAgICAgIDxkaXY-XG4gICAgICAgICAgPGxhYmVsPjxtZC1jaGVja2JveD48L21kLWNoZWNrYm94PkNhbiBjbGljayA8c3Bhbj53aXRoIDpmb2N1cy12aXNpYmxlPC9zcGFuPjwvbGFiZWw-XG4gICAgICAgIDwvZGl2PlxuICAgICAgICA8ZGl2PlxuICAgICAgICAgIDxsYWJlbD48bWQtZmlsbGVkLXRleHQtZmllbGQ-PC9tZC1maWxsZWQtdGV4dC1maWVsZD5DYW4gY2xpY2sgPHNwYW4-Y2FuJ3QgY2xpY2s8L3NwYW4-PC9sYWJlbD5cbiAgICAgICAgPC9kaXY-XG4gICAgYDtcbiAgfVxufVxuIn0seyJuYW1lIjoiaW5kZXguaHRtbCIsImNvbnRlbnQiOiI8IURPQ1RZUEUgaHRtbD5cbjxoZWFkPlxuICA8c2NyaXB0IHR5cGU9XCJtb2R1bGVcIiBzcmM9XCIuL3NpbXBsZS1ncmVldGluZy5qc1wiPjwvc2NyaXB0PlxuPC9oZWFkPlxuPGJvZHk-XG4gIDxzaW1wbGUtZ3JlZXRpbmcgbmFtZT1cIldvcmxkXCI-PC9zaW1wbGUtZ3JlZXRpbmc-XG48L2JvZHk-XG4ifSx7Im5hbWUiOiJwYWNrYWdlLmpzb24iLCJjb250ZW50Ijoie1xuICBcImRlcGVuZGVuY2llc1wiOiB7XG4gICAgXCJsaXRcIjogXCJeMy4wLjBcIixcbiAgICBcIkBsaXQvcmVhY3RpdmUtZWxlbWVudFwiOiBcIl4yLjAuMFwiLFxuICAgIFwibGl0LWVsZW1lbnRcIjogXCJeNC4wLjBcIixcbiAgICBcImxpdC1odG1sXCI6IFwiXjMuMC4wXCIsXG4gICAgXCJAbWF0ZXJpYWwvd2ViXCI6IFwiXjEuNS4xXCJcbiAgfVxufSJ9XQ

Workaround

No

Is this a regression?

No or unsure. This never worked, or I haven't tried before.

Affected versions

Failing in 1.5.1

Browser/OS/Node environment

Chrome v. 126

@Lookwe69
Copy link
Author

Update with chrome 129.
:focus-visible is added even if we click directly on the label

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