fix: enable focus-visible in Firefox 90 (#2075)

volta
Nolan Lawson 2021-07-16 07:14:15 -07:00 zatwierdzone przez GitHub
rodzic d84f4604ad
commit d30f7f4b1a
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
3 zmienionych plików z 12 dodań i 8 usunięć

Wyświetl plik

@ -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')))

Wyświetl plik

@ -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
})

Wyświetl plik

@ -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
})