Skip to content

Commit ec11d41

Browse files
Googlermdodgelooker
authored andcommitted
Project import generated by Copybara.
FolderOrigin-RevId: /usr/local/google/home/meredithdodge/helltool/.
1 parent 7ece4e7 commit ec11d41

File tree

1,782 files changed

+172921
-14087
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,782 files changed

+172921
-14087
lines changed

packages/components-data/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"license": "MIT",
44
"main": "lib/main/index.js",
55
"module": "lib/module/index.js",
6-
"types": "lib/index.d.ts",
6+
"types": "src/index.ts",
77
"src": "src/index.ts",
88
"version": "1.0.3",
99
"sideEffects": false,
@@ -25,7 +25,7 @@
2525
"prepublishOnly": "lk prepublishOnly"
2626
},
2727
"dependencies": {
28-
"@looker/components": "4.1.1",
28+
"@looker/components": "^4.1.3",
2929
"@looker/sdk": "^22.4.2",
3030
"@looker/sdk-rtl": "^21.3.3",
3131
"@looker/visualizations-adapters": "^1.0.3",

packages/components-providers/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"name": "@looker/components-providers",
33
"license": "MIT",
4-
"version": "1.5.30",
4+
"version": "1.5.31",
55
"main": "lib/main/index.js",
66
"module": "lib/module/index.js",
7-
"types": "lib/index.d.ts",
7+
"types": "src/index.ts",
88
"src": "src/index.ts",
99
"sideEffects": false,
1010
"publishConfig": {
@@ -24,7 +24,7 @@
2424
"prepublishOnly": "lk prepublishOnly"
2525
},
2626
"dependencies": {
27-
"@looker/design-tokens": "3.1.0",
27+
"@looker/design-tokens": "^3.1.1",
2828
"@looker/i18n": "1.0.0",
2929
"i18next": "20.3.1",
3030
"react-helmet-async": "^1.0.9",

packages/components-providers/src/FocusTrap/utils.ts

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,6 @@ import { tabbable, isFocusable, isTabbable } from 'tabbable'
3636
import type { Trap } from '../TrapStack/types'
3737
import type { FocusTrapOptions } from './types'
3838

39-
// Firefox reverts focus to the body when using Select. activeElement keeps
40-
// track of which element should maintain focus after selection
41-
let activeElement: Element | null
42-
4339
// Evergreens support :focus-visible but JSDom still does not, so we must use
4440
// this to check for support before using the selector.
4541
const isFocusVisible = (element = document.activeElement) => {
@@ -87,8 +83,8 @@ export const activateFocusTrap = ({
8783

8884
const getInitialFocusNodeByPriority = () => {
8985
// Return the already focused node within element
90-
if (element.contains(activeElement as Node)) {
91-
return activeElement
86+
if (element.contains(document.activeElement as Node)) {
87+
return document.activeElement
9288
}
9389

9490
// Look for data-autofocus b/c React strips autofocus from dom
@@ -172,21 +168,18 @@ export const activateFocusTrap = ({
172168
// This needs to be done on mousedown and touchstart instead of click
173169
// so that it precedes the focus event.
174170
const checkPointerDown = function (e: MouseEvent | TouchEvent) {
175-
if (element.contains(e.target as Node)) {
176-
activeElement = e.target as Element
177-
} else if (options?.clickOutsideDeactivates) {
171+
if (
172+
!element.contains(e.target as Node) &&
173+
options?.clickOutsideDeactivates
174+
) {
178175
deactivate()
179176
}
180177
}
181178

182179
// In case focus escapes the trap for some strange reason, pull it back in.
183180
const checkFocusIn = (e: FocusEvent) => {
184-
if (element.contains(e.target as Node)) {
185-
activeElement = e.target as Element
186-
return
187-
}
188181
// In Firefox when you Tab out of an iframe the Document is briefly focused.
189-
if (e.target instanceof Document) {
182+
if (element.contains(e.target as Node) || e.target instanceof Document) {
190183
return
191184
}
192185
e.stopImmediatePropagation()

0 commit comments

Comments
 (0)