@workday/canvas-kit-react 8.0.0-alpha.203-next.3 → 8.0.0-alpha.208-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commonjs/modal/lib/ModalCard.d.ts.map +1 -1
- package/dist/commonjs/modal/lib/ModalCard.js +2 -1
- package/dist/commonjs/modal/lib/ModalHeading.d.ts.map +1 -1
- package/dist/commonjs/modal/lib/ModalHeading.js +11 -1
- package/dist/commonjs/popup/lib/hooks/useReturnFocus.d.ts.map +1 -1
- package/dist/commonjs/popup/lib/hooks/useReturnFocus.js +31 -2
- package/dist/es6/modal/lib/ModalCard.d.ts.map +1 -1
- package/dist/es6/modal/lib/ModalCard.js +2 -1
- package/dist/es6/modal/lib/ModalHeading.d.ts.map +1 -1
- package/dist/es6/modal/lib/ModalHeading.js +12 -2
- package/dist/es6/popup/lib/hooks/useReturnFocus.d.ts.map +1 -1
- package/dist/es6/popup/lib/hooks/useReturnFocus.js +31 -2
- package/modal/lib/ModalCard.tsx +2 -1
- package/modal/lib/ModalHeading.tsx +14 -2
- package/package.json +3 -3
- package/popup/lib/hooks/useReturnFocus.tsx +37 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModalCard.d.ts","sourceRoot":"","sources":["../../../../modal/lib/ModalCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAEL,YAAY,EAGb,MAAM,kCAAkC,CAAC;AAE1C,OAAO,EAAC,KAAK,EAAC,MAAM,iCAAiC,CAAC;AAItD,MAAM,WAAW,cAAe,SAAQ,YAAY,CAAC,OAAO,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC;CAAG;
|
|
1
|
+
{"version":3,"file":"ModalCard.d.ts","sourceRoot":"","sources":["../../../../modal/lib/ModalCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAEL,YAAY,EAGb,MAAM,kCAAkC,CAAC;AAE1C,OAAO,EAAC,KAAK,EAAC,MAAM,iCAAiC,CAAC;AAItD,MAAM,WAAW,cAAe,SAAQ,YAAY,CAAC,OAAO,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC;CAAG;AAYjF,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;EAMpB,CAAC"}
|
|
@@ -45,7 +45,8 @@ var ResponsiveModalCard = common_1.styled(popup_1.Popup.Card)(function (_a) {
|
|
|
45
45
|
},
|
|
46
46
|
_b[theme.canvas.breakpoints.down('s')] = {
|
|
47
47
|
margin: "0 0 " + tokens_1.space.xl,
|
|
48
|
-
padding: tokens_1.space.
|
|
48
|
+
padding: tokens_1.space.s,
|
|
49
|
+
borderRadius: tokens_1.space.m,
|
|
49
50
|
},
|
|
50
51
|
_b);
|
|
51
52
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModalHeading.d.ts","sourceRoot":"","sources":["../../../../modal/lib/ModalHeading.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,
|
|
1
|
+
{"version":3,"file":"ModalHeading.d.ts","sourceRoot":"","sources":["../../../../modal/lib/ModalHeading.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAEL,YAAY,EAGb,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAC,KAAK,EAAC,MAAM,iCAAiC,CAAC;AAKtD,MAAM,WAAW,iBAAkB,SAAQ,YAAY,CAAC,OAAO,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC;CAAG;AAQvF,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;EAMvB,CAAC"}
|
|
@@ -34,11 +34,21 @@ exports.ModalHeading = void 0;
|
|
|
34
34
|
var React = __importStar(require("react"));
|
|
35
35
|
var common_1 = require("@workday/canvas-kit-react/common");
|
|
36
36
|
var popup_1 = require("@workday/canvas-kit-react/popup");
|
|
37
|
+
var tokens_1 = require("@workday/canvas-kit-react/tokens");
|
|
37
38
|
var hooks_1 = require("./hooks");
|
|
39
|
+
var ResponsiveModalHeading = common_1.styled(popup_1.Popup.Heading)(function (_a) {
|
|
40
|
+
var _b;
|
|
41
|
+
var theme = _a.theme;
|
|
42
|
+
return (_b = {},
|
|
43
|
+
_b[theme.canvas.breakpoints.down('s')] = {
|
|
44
|
+
marginBottom: tokens_1.space.zero,
|
|
45
|
+
},
|
|
46
|
+
_b);
|
|
47
|
+
});
|
|
38
48
|
exports.ModalHeading = common_1.createSubcomponent('h2')({
|
|
39
49
|
displayName: 'Modal.Heading',
|
|
40
50
|
modelHook: hooks_1.useModalModel,
|
|
41
51
|
elemPropsHook: hooks_1.useModalHeading,
|
|
42
52
|
})(function (elemProps, Element) {
|
|
43
|
-
return React.createElement(
|
|
53
|
+
return React.createElement(ResponsiveModalHeading, __assign({ as: Element }, elemProps));
|
|
44
54
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useReturnFocus.d.ts","sourceRoot":"","sources":["../../../../../popup/lib/hooks/useReturnFocus.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B;;;;;;GAMG;AACH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"useReturnFocus.d.ts","sourceRoot":"","sources":["../../../../../popup/lib/hooks/useReturnFocus.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B;;;;;;GAMG;AACH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;OAiDzB,CAAC"}
|
|
@@ -16,15 +16,44 @@ var usePopupModel_1 = require("./usePopupModel");
|
|
|
16
16
|
*/
|
|
17
17
|
exports.useReturnFocus = common_1.createElemPropsHook(usePopupModel_1.usePopupModel)(function (model) {
|
|
18
18
|
var visible = model.state.visibility !== 'hidden';
|
|
19
|
+
// This boolean tracks keyboard-driven focus changes. This is required for `useFocusRedirect` as
|
|
20
|
+
// focus redirection needs synchronous focus management and everything else needs asynchronous
|
|
21
|
+
// focus management.
|
|
22
|
+
var requiresFocusChangeRef = react_1.default.useRef(false);
|
|
23
|
+
var onKeyDown = react_1.default.useCallback(function (event) {
|
|
24
|
+
// The tab key changes focus
|
|
25
|
+
if (event.key === 'Tab') {
|
|
26
|
+
requiresFocusChangeRef.current = true;
|
|
27
|
+
}
|
|
28
|
+
}, []);
|
|
29
|
+
var onKeyUp = react_1.default.useCallback(function (event) {
|
|
30
|
+
requiresFocusChangeRef.current = false;
|
|
31
|
+
}, []);
|
|
19
32
|
react_1.default.useLayoutEffect(function () {
|
|
20
33
|
if (!visible) {
|
|
21
34
|
return;
|
|
22
35
|
}
|
|
23
36
|
// capture the element here. The refs will be null by the time the cleanup function is called
|
|
24
37
|
var element = (model.state.returnFocusRef || model.state.targetRef).current;
|
|
38
|
+
document.addEventListener('keydown', onKeyDown, true);
|
|
39
|
+
document.addEventListener('keyup', onKeyUp, true);
|
|
25
40
|
return function () {
|
|
26
|
-
|
|
41
|
+
document.removeEventListener('keydown', onKeyDown, true);
|
|
42
|
+
document.removeEventListener('keyup', onKeyUp, true);
|
|
43
|
+
if (requiresFocusChangeRef.current) {
|
|
44
|
+
// We need to change focus _before_ the browser process the default action of picking a new
|
|
45
|
+
// focus target. Doing this immediately prevents the `focus` event from firing on `element`,
|
|
46
|
+
// but that's okay because the browser will change focus anyways.
|
|
47
|
+
common_1.changeFocus(element);
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
// We wait a frame for the current event to process, allowing the browser to fire default
|
|
51
|
+
// actions. This delay allows the focus change to trigger a `focus` event on `element`.
|
|
52
|
+
requestAnimationFrame(function () {
|
|
53
|
+
common_1.changeFocus(element);
|
|
54
|
+
});
|
|
55
|
+
}
|
|
27
56
|
};
|
|
28
|
-
}, [model.state.returnFocusRef, model.state.targetRef, visible]);
|
|
57
|
+
}, [model.state.returnFocusRef, model.state.targetRef, visible, onKeyDown, onKeyUp]);
|
|
29
58
|
return {};
|
|
30
59
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModalCard.d.ts","sourceRoot":"","sources":["../../../../modal/lib/ModalCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAEL,YAAY,EAGb,MAAM,kCAAkC,CAAC;AAE1C,OAAO,EAAC,KAAK,EAAC,MAAM,iCAAiC,CAAC;AAItD,MAAM,WAAW,cAAe,SAAQ,YAAY,CAAC,OAAO,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC;CAAG;
|
|
1
|
+
{"version":3,"file":"ModalCard.d.ts","sourceRoot":"","sources":["../../../../modal/lib/ModalCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAEL,YAAY,EAGb,MAAM,kCAAkC,CAAC;AAE1C,OAAO,EAAC,KAAK,EAAC,MAAM,iCAAiC,CAAC;AAItD,MAAM,WAAW,cAAe,SAAQ,YAAY,CAAC,OAAO,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC;CAAG;AAYjF,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;EAMpB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModalHeading.d.ts","sourceRoot":"","sources":["../../../../modal/lib/ModalHeading.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,
|
|
1
|
+
{"version":3,"file":"ModalHeading.d.ts","sourceRoot":"","sources":["../../../../modal/lib/ModalHeading.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAEL,YAAY,EAGb,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAC,KAAK,EAAC,MAAM,iCAAiC,CAAC;AAKtD,MAAM,WAAW,iBAAkB,SAAQ,YAAY,CAAC,OAAO,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC;CAAG;AAQvF,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;EAMvB,CAAC"}
|
|
@@ -10,13 +10,23 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
12
|
import * as React from 'react';
|
|
13
|
-
import { createSubcomponent } from '@workday/canvas-kit-react/common';
|
|
13
|
+
import { createSubcomponent, styled, } from '@workday/canvas-kit-react/common';
|
|
14
14
|
import { Popup } from '@workday/canvas-kit-react/popup';
|
|
15
|
+
import { space } from '@workday/canvas-kit-react/tokens';
|
|
15
16
|
import { useModalHeading, useModalModel } from './hooks';
|
|
17
|
+
var ResponsiveModalHeading = styled(Popup.Heading)(function (_a) {
|
|
18
|
+
var _b;
|
|
19
|
+
var theme = _a.theme;
|
|
20
|
+
return (_b = {},
|
|
21
|
+
_b[theme.canvas.breakpoints.down('s')] = {
|
|
22
|
+
marginBottom: space.zero,
|
|
23
|
+
},
|
|
24
|
+
_b);
|
|
25
|
+
});
|
|
16
26
|
export var ModalHeading = createSubcomponent('h2')({
|
|
17
27
|
displayName: 'Modal.Heading',
|
|
18
28
|
modelHook: useModalModel,
|
|
19
29
|
elemPropsHook: useModalHeading,
|
|
20
30
|
})(function (elemProps, Element) {
|
|
21
|
-
return React.createElement(
|
|
31
|
+
return React.createElement(ResponsiveModalHeading, __assign({ as: Element }, elemProps));
|
|
22
32
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useReturnFocus.d.ts","sourceRoot":"","sources":["../../../../../popup/lib/hooks/useReturnFocus.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B;;;;;;GAMG;AACH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"useReturnFocus.d.ts","sourceRoot":"","sources":["../../../../../popup/lib/hooks/useReturnFocus.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B;;;;;;GAMG;AACH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;OAiDzB,CAAC"}
|
|
@@ -10,15 +10,44 @@ import { usePopupModel } from './usePopupModel';
|
|
|
10
10
|
*/
|
|
11
11
|
export var useReturnFocus = createElemPropsHook(usePopupModel)(function (model) {
|
|
12
12
|
var visible = model.state.visibility !== 'hidden';
|
|
13
|
+
// This boolean tracks keyboard-driven focus changes. This is required for `useFocusRedirect` as
|
|
14
|
+
// focus redirection needs synchronous focus management and everything else needs asynchronous
|
|
15
|
+
// focus management.
|
|
16
|
+
var requiresFocusChangeRef = React.useRef(false);
|
|
17
|
+
var onKeyDown = React.useCallback(function (event) {
|
|
18
|
+
// The tab key changes focus
|
|
19
|
+
if (event.key === 'Tab') {
|
|
20
|
+
requiresFocusChangeRef.current = true;
|
|
21
|
+
}
|
|
22
|
+
}, []);
|
|
23
|
+
var onKeyUp = React.useCallback(function (event) {
|
|
24
|
+
requiresFocusChangeRef.current = false;
|
|
25
|
+
}, []);
|
|
13
26
|
React.useLayoutEffect(function () {
|
|
14
27
|
if (!visible) {
|
|
15
28
|
return;
|
|
16
29
|
}
|
|
17
30
|
// capture the element here. The refs will be null by the time the cleanup function is called
|
|
18
31
|
var element = (model.state.returnFocusRef || model.state.targetRef).current;
|
|
32
|
+
document.addEventListener('keydown', onKeyDown, true);
|
|
33
|
+
document.addEventListener('keyup', onKeyUp, true);
|
|
19
34
|
return function () {
|
|
20
|
-
|
|
35
|
+
document.removeEventListener('keydown', onKeyDown, true);
|
|
36
|
+
document.removeEventListener('keyup', onKeyUp, true);
|
|
37
|
+
if (requiresFocusChangeRef.current) {
|
|
38
|
+
// We need to change focus _before_ the browser process the default action of picking a new
|
|
39
|
+
// focus target. Doing this immediately prevents the `focus` event from firing on `element`,
|
|
40
|
+
// but that's okay because the browser will change focus anyways.
|
|
41
|
+
changeFocus(element);
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
// We wait a frame for the current event to process, allowing the browser to fire default
|
|
45
|
+
// actions. This delay allows the focus change to trigger a `focus` event on `element`.
|
|
46
|
+
requestAnimationFrame(function () {
|
|
47
|
+
changeFocus(element);
|
|
48
|
+
});
|
|
49
|
+
}
|
|
21
50
|
};
|
|
22
|
-
}, [model.state.returnFocusRef, model.state.targetRef, visible]);
|
|
51
|
+
}, [model.state.returnFocusRef, model.state.targetRef, visible, onKeyDown, onKeyUp]);
|
|
23
52
|
return {};
|
|
24
53
|
});
|
package/modal/lib/ModalCard.tsx
CHANGED
|
@@ -18,7 +18,8 @@ const ResponsiveModalCard = styled(Popup.Card)<ModalCardProps & StyledType>(({th
|
|
|
18
18
|
padding: space.l,
|
|
19
19
|
[theme.canvas.breakpoints.down('s')]: {
|
|
20
20
|
margin: `0 0 ${space.xl}`,
|
|
21
|
-
padding: space.
|
|
21
|
+
padding: space.s,
|
|
22
|
+
borderRadius: space.m, // matches mobile specs
|
|
22
23
|
},
|
|
23
24
|
}));
|
|
24
25
|
|
|
@@ -1,16 +1,28 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
createSubcomponent,
|
|
5
|
+
ExtractProps,
|
|
6
|
+
styled,
|
|
7
|
+
StyledType,
|
|
8
|
+
} from '@workday/canvas-kit-react/common';
|
|
4
9
|
import {Popup} from '@workday/canvas-kit-react/popup';
|
|
10
|
+
import {space} from '@workday/canvas-kit-react/tokens';
|
|
5
11
|
|
|
6
12
|
import {useModalHeading, useModalModel} from './hooks';
|
|
7
13
|
|
|
8
14
|
export interface ModalHeadingProps extends ExtractProps<typeof Popup.Heading, never> {}
|
|
9
15
|
|
|
16
|
+
const ResponsiveModalHeading = styled(Popup.Heading)<ModalHeadingProps & StyledType>(({theme}) => ({
|
|
17
|
+
[theme.canvas.breakpoints.down('s')]: {
|
|
18
|
+
marginBottom: space.zero,
|
|
19
|
+
},
|
|
20
|
+
}));
|
|
21
|
+
|
|
10
22
|
export const ModalHeading = createSubcomponent('h2')({
|
|
11
23
|
displayName: 'Modal.Heading',
|
|
12
24
|
modelHook: useModalModel,
|
|
13
25
|
elemPropsHook: useModalHeading,
|
|
14
26
|
})<ModalHeadingProps>((elemProps, Element) => {
|
|
15
|
-
return <
|
|
27
|
+
return <ResponsiveModalHeading as={Element} {...elemProps} />;
|
|
16
28
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@workday/canvas-kit-react",
|
|
3
|
-
"version": "8.0.0-alpha.
|
|
3
|
+
"version": "8.0.0-alpha.208-next.1+7ab4aa5f",
|
|
4
4
|
"description": "The parent module that contains all Workday Canvas Kit React components",
|
|
5
5
|
"author": "Workday, Inc. (https://www.workday.com)",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"@emotion/styled": "^11.6.0",
|
|
50
50
|
"@popperjs/core": "^2.5.4",
|
|
51
51
|
"@workday/canvas-colors-web": "^2.0.0",
|
|
52
|
-
"@workday/canvas-kit-popup-stack": "^8.0.0-alpha.
|
|
52
|
+
"@workday/canvas-kit-popup-stack": "^8.0.0-alpha.208-next.1+7ab4aa5f",
|
|
53
53
|
"@workday/canvas-system-icons-web": "^3.0.0",
|
|
54
54
|
"@workday/design-assets-types": "^0.2.8",
|
|
55
55
|
"chroma-js": "^2.1.0",
|
|
@@ -67,5 +67,5 @@
|
|
|
67
67
|
"@workday/canvas-accent-icons-web": "^3.0.0",
|
|
68
68
|
"@workday/canvas-applet-icons-web": "^2.0.0"
|
|
69
69
|
},
|
|
70
|
-
"gitHead": "
|
|
70
|
+
"gitHead": "7ab4aa5fb8c81b2929cab767cd3dfd0dd7d2372f"
|
|
71
71
|
}
|
|
@@ -14,16 +14,50 @@ import {usePopupModel} from './usePopupModel';
|
|
|
14
14
|
export const useReturnFocus = createElemPropsHook(usePopupModel)(model => {
|
|
15
15
|
const visible = model.state.visibility !== 'hidden';
|
|
16
16
|
|
|
17
|
+
// This boolean tracks keyboard-driven focus changes. This is required for `useFocusRedirect` as
|
|
18
|
+
// focus redirection needs synchronous focus management and everything else needs asynchronous
|
|
19
|
+
// focus management.
|
|
20
|
+
const requiresFocusChangeRef = React.useRef(false);
|
|
21
|
+
|
|
22
|
+
const onKeyDown = React.useCallback((event: KeyboardEvent) => {
|
|
23
|
+
// The tab key changes focus
|
|
24
|
+
if (event.key === 'Tab') {
|
|
25
|
+
requiresFocusChangeRef.current = true;
|
|
26
|
+
}
|
|
27
|
+
}, []);
|
|
28
|
+
|
|
29
|
+
const onKeyUp = React.useCallback((event: KeyboardEvent) => {
|
|
30
|
+
requiresFocusChangeRef.current = false;
|
|
31
|
+
}, []);
|
|
32
|
+
|
|
17
33
|
React.useLayoutEffect(() => {
|
|
18
34
|
if (!visible) {
|
|
19
35
|
return;
|
|
20
36
|
}
|
|
21
37
|
// capture the element here. The refs will be null by the time the cleanup function is called
|
|
22
|
-
const element = (model.state.returnFocusRef || model.state.targetRef).current;
|
|
38
|
+
const element = (model.state.returnFocusRef || model.state.targetRef).current as HTMLElement;
|
|
39
|
+
|
|
40
|
+
document.addEventListener('keydown', onKeyDown, true);
|
|
41
|
+
document.addEventListener('keyup', onKeyUp, true);
|
|
42
|
+
|
|
23
43
|
return () => {
|
|
24
|
-
|
|
44
|
+
document.removeEventListener('keydown', onKeyDown, true);
|
|
45
|
+
document.removeEventListener('keyup', onKeyUp, true);
|
|
46
|
+
|
|
47
|
+
if (requiresFocusChangeRef.current) {
|
|
48
|
+
// We need to change focus _before_ the browser process the default action of picking a new
|
|
49
|
+
// focus target. Doing this immediately prevents the `focus` event from firing on `element`,
|
|
50
|
+
// but that's okay because the browser will change focus anyways.
|
|
51
|
+
changeFocus(element);
|
|
52
|
+
} else {
|
|
53
|
+
// We wait a frame for the current event to process, allowing the browser to fire default
|
|
54
|
+
// actions. This delay allows the focus change to trigger a `focus` event on `element`.
|
|
55
|
+
requestAnimationFrame(() => {
|
|
56
|
+
changeFocus(element);
|
|
57
|
+
});
|
|
58
|
+
}
|
|
25
59
|
};
|
|
26
|
-
}, [model.state.returnFocusRef, model.state.targetRef, visible]);
|
|
60
|
+
}, [model.state.returnFocusRef, model.state.targetRef, visible, onKeyDown, onKeyUp]);
|
|
27
61
|
|
|
28
62
|
return {};
|
|
29
63
|
});
|