fix: enable focus-visible in Firefox 90

This commit is contained in:
Nolan Lawson 2021-07-11 12:47:18 -07:00
parent 374b8b251e
commit d11dad6fb4
3 changed files with 12 additions and 8 deletions

View File

@ -1,8 +1,8 @@
import { thunk } from './thunk.js'
import { supportsSelector } from './supportsSelector.js'
import { isFirefox } from './userAgent/isFirefox.js'
import { isFirefoxPre90 } from './userAgent/isFirefoxPre90.js'
// Disabling for now in Firefox due to bugs:
// Disabling in Firefox <90 due to bugs:
// https://bugzilla.mozilla.org/show_bug.cgi?id=1699154
// https://bugzilla.mozilla.org/show_bug.cgi?id=1711057
export const supportsFocusVisible = thunk(() => (!isFirefox() && supportsSelector(':focus-visible')))
export const supportsFocusVisible = thunk(() => (!isFirefoxPre90() && supportsSelector(':focus-visible')))

View File

@ -1,5 +0,0 @@
import { thunk } from '../thunk.js'
export const isFirefox = thunk(() => {
return process.browser && typeof InstallTrigger !== 'undefined' // https://stackoverflow.com/a/9851769/680742
})

View File

@ -0,0 +1,9 @@
import { thunk } from '../thunk.js'
export const isFirefoxPre90 = thunk(() => {
return process.browser &&
// https://stackoverflow.com/a/9851769/680742
typeof InstallTrigger !== 'undefined' &&
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/at#browser_compatibility
!Array.prototype.at
})