Created
April 15, 2019 16:19
-
-
Save cbejensen/e507050ef40ff60e681c0a992c72e033 to your computer and use it in GitHub Desktop.
Check for support of :focus-within
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let supportsCSSFocusWithin = false | |
try { | |
document.querySelector(':focus-within') | |
} catch (err) { | |
supportsCSSFocusWithin = false | |
} | |
const wrapper = document.querySelector('wrapper') | |
wrapper.addEventListener('focusin', e => { | |
if (!supportsCSSFocusWithin) { | |
// handle it | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment