Skip to content

Instantly share code, notes, and snippets.

@nolanlawson
Created April 22, 2021 18:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nolanlawson/d8ddc518041e9bf12498b8b50b39df95 to your computer and use it in GitHub Desktop.
Save nolanlawson/d8ddc518041e9bf12498b8b50b39df95 to your computer and use it in GitHub Desktop.
Repro Firefox focusin event issue
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Repro Firefox focusin event issue</title>
</head>
<body>
<h1>Repro Firefox focusin event issue</h1>
<div>
<input type="text">
</div>
<script type="module">
document.querySelector('div').addEventListener('focusin', event => {
console.log('focusin called', event.target, event.relatedTarget)
})
document.addEventListener('DOMContentLoaded', () => {
document.querySelector('input').focus()
})
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment