-
Notifications
You must be signed in to change notification settings - Fork 100
Open
Description
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
<html>
<body>
<button tabindex="-1">Click me</button>
<script>
const button = document.querySelector("button")
// focus event is fixed with custom firing
button.addEventListener("mousedown", event => {
if (event.currentTarget.tagName === 'BUTTON') {
event.currentTarget.focus();
}
});
button.addEventListener("focus", () => {
console.log("focus");
});
// sadly blur is fired straight after focus
button.addEventListener("blur", () => {
console.log('blur');
})
</script>
</body>
</html>
/cc @souporserious
Metadata
Metadata
Assignees
Labels
No labels