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

Clicking on a focusable element doesn't focus it #26899

Closed
jdm opened this issue Jun 12, 2020 · 2 comments
Closed

Clicking on a focusable element doesn't focus it #26899

jdm opened this issue Jun 12, 2020 · 2 comments

Comments

@jdm
Copy link
Member

@jdm jdm commented Jun 12, 2020

<style>div:focus { color: red; }</style>
<div tabindex=0 style="background-color: green; width: 100px; height: 100px;"><p>hello</p></div>
<button onclick="document.querySelector('div').focus()">focus</button>

The tabindex=0 makes the element focusable. In Firefox clicking on the element turns the text red; in Servo it does not.

@jdm jdm added the A-content/dom label Jun 12, 2020
@jdm
Copy link
Member Author

@jdm jdm commented Jun 12, 2020

Clicking on the rest of the page does make the div unfocused if it is focused, however.

@jdm jdm self-assigned this Jun 12, 2020
@jdm
Copy link
Member Author

@jdm jdm commented Jun 15, 2020

Fixed by #26902.

@jdm jdm closed this Jun 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.