@workday/canvas-kit-react 9.1.17 → 9.1.19

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.
@@ -53,7 +53,7 @@ exports.useReturnFocus = common_1.createElemPropsHook(usePopupModel_1.usePopupMo
53
53
  // track mousedown events to determine if the mouse target is a focusable element. If it is, we
54
54
  // should not return focus
55
55
  const onMouseDown = react_1.default.useCallback((event) => {
56
- if (model.state.stackRef.current && event.target instanceof HTMLElement) {
56
+ if (model.state.stackRef.current && event.target instanceof Element) {
57
57
  if (!canvas_kit_popup_stack_1.PopupStack.contains(model.state.stackRef.current, event.target)) {
58
58
  elementRef.current = event.target;
59
59
  }
@@ -106,7 +106,7 @@ exports.useReturnFocus = common_1.createElemPropsHook(usePopupModel_1.usePopupMo
106
106
  }
107
107
  const activeElementOutsidePopupStack = document.activeElement !== document.body &&
108
108
  model.state.stackRef.current &&
109
- document.activeElement instanceof HTMLElement &&
109
+ document.activeElement instanceof Element &&
110
110
  !canvas_kit_popup_stack_1.PopupStack.contains(model.state.stackRef.current, document.activeElement);
111
111
  if (activeElementOutsidePopupStack || requiresFocusChangeRef.current) {
112
112
  // We need to change focus _before_ the browser process the default action of picking a new
@@ -47,7 +47,7 @@ export const useReturnFocus = createElemPropsHook(usePopupModel)(model => {
47
47
  // track mousedown events to determine if the mouse target is a focusable element. If it is, we
48
48
  // should not return focus
49
49
  const onMouseDown = React.useCallback((event) => {
50
- if (model.state.stackRef.current && event.target instanceof HTMLElement) {
50
+ if (model.state.stackRef.current && event.target instanceof Element) {
51
51
  if (!PopupStack.contains(model.state.stackRef.current, event.target)) {
52
52
  elementRef.current = event.target;
53
53
  }
@@ -100,7 +100,7 @@ export const useReturnFocus = createElemPropsHook(usePopupModel)(model => {
100
100
  }
101
101
  const activeElementOutsidePopupStack = document.activeElement !== document.body &&
102
102
  model.state.stackRef.current &&
103
- document.activeElement instanceof HTMLElement &&
103
+ document.activeElement instanceof Element &&
104
104
  !PopupStack.contains(model.state.stackRef.current, document.activeElement);
105
105
  if (activeElementOutsidePopupStack || requiresFocusChangeRef.current) {
106
106
  // We need to change focus _before_ the browser process the default action of picking a new
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@workday/canvas-kit-react",
3
- "version": "9.1.17",
3
+ "version": "9.1.19",
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": "^9.1.17",
52
+ "@workday/canvas-kit-popup-stack": "^9.1.19",
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",
@@ -66,5 +66,5 @@
66
66
  "@workday/canvas-accent-icons-web": "^3.0.0",
67
67
  "@workday/canvas-applet-icons-web": "^2.0.0"
68
68
  },
69
- "gitHead": "5304ed1dc5fe59ebea07a427f781db7b599bc783"
69
+ "gitHead": "215854298456c8c009e771bdab2570027f4c68d6"
70
70
  }
@@ -58,8 +58,8 @@ export const useReturnFocus = createElemPropsHook(usePopupModel)(model => {
58
58
  // should not return focus
59
59
  const onMouseDown = React.useCallback(
60
60
  (event: MouseEvent) => {
61
- if (model.state.stackRef.current && event.target instanceof HTMLElement) {
62
- if (!PopupStack.contains(model.state.stackRef.current, event.target)) {
61
+ if (model.state.stackRef.current && event.target instanceof Element) {
62
+ if (!PopupStack.contains(model.state.stackRef.current, event.target as HTMLElement)) {
63
63
  elementRef.current = event.target;
64
64
  }
65
65
  }
@@ -119,8 +119,8 @@ export const useReturnFocus = createElemPropsHook(usePopupModel)(model => {
119
119
  const activeElementOutsidePopupStack =
120
120
  document.activeElement !== document.body &&
121
121
  model.state.stackRef.current &&
122
- document.activeElement instanceof HTMLElement &&
123
- !PopupStack.contains(model.state.stackRef.current, document.activeElement);
122
+ document.activeElement instanceof Element &&
123
+ !PopupStack.contains(model.state.stackRef.current, document.activeElement as HTMLElement);
124
124
 
125
125
  if (activeElementOutsidePopupStack || requiresFocusChangeRef.current) {
126
126
  // We need to change focus _before_ the browser process the default action of picking a new