-
Notifications
You must be signed in to change notification settings - Fork 100
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
FocusManager fails with buttons in safari and firefox #138
Comments
I like the idea of using |
button.addEventListener('mousedown', event => {
if (event.currentTarget.tagName === 'BUTTON') {
event.preventDefault();
event.currentTarget.focus();
}
})
button.addEventListener('focus', () => {
console.log('focus');
});
button.addEventListener('blur', () => {
console.log('blur')
}) |
Here's reproducing example. The problem now is iphone. My friend said blur doesn't work. After clicking at button test became focused and then nothing happend after clicking to whitespace. https://codesandbox.io/s/ppy6kv0w67 I don't have iphone to test. @souporserious could you take a look? |
I had a little bit of time to look at this, but I'm not sure the best route to fix this 😞. I was able to get it working by listening to |
Yep, looks not the best. Even pointer events are not supported by safari :( |
@souporserious What if we will add |
Hmm not sure what you mean by |
Yes, |
Oh interesting! I didn't know Safari would catch clicks if you add |
It's just an idea. I'm not sure this will work. |
We need to find some solution to work around it both safari and firefox
Ref https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#Clicking_and_focus
Example
/cc @souporserious
The text was updated successfully, but these errors were encountered: