@workday/canvas-kit-react 9.1.34 → 9.1.36

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.
@@ -1 +1 @@
1
- {"version":3,"file":"useCloseOnOutsideClick.d.ts","sourceRoot":"","sources":["../../../../../popup/lib/hooks/useCloseOnOutsideClick.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B;;;;;;;;;GASG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;MAsCjC,CAAC"}
1
+ {"version":3,"file":"useCloseOnOutsideClick.d.ts","sourceRoot":"","sources":["../../../../../popup/lib/hooks/useCloseOnOutsideClick.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B;;;;;;;;;GASG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;MAwCjC,CAAC"}
@@ -28,6 +28,8 @@ exports.useCloseOnOutsideClick = common_1.createElemPropsHook(usePopupModel_1.us
28
28
  .sort((a, b) => Number(a.style.zIndex) - Number(b.style.zIndex));
29
29
  if (elements.length &&
30
30
  elements[elements.length - 1] === model.state.stackRef.current &&
31
+ // Only consider event targets that are currently in the DOM as valid
32
+ document.contains(event.target) &&
31
33
  // Use `PopupStack.contains` instead of `ref.current.contains` so that the application can
32
34
  // decide if clicking the target should toggle the popup rather than it toggling implicitly
33
35
  // because the target is outside `ref.current`
@@ -1 +1 @@
1
- {"version":3,"file":"useCloseOnOutsideClick.d.ts","sourceRoot":"","sources":["../../../../../popup/lib/hooks/useCloseOnOutsideClick.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B;;;;;;;;;GASG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;MAsCjC,CAAC"}
1
+ {"version":3,"file":"useCloseOnOutsideClick.d.ts","sourceRoot":"","sources":["../../../../../popup/lib/hooks/useCloseOnOutsideClick.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B;;;;;;;;;GASG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;MAwCjC,CAAC"}
@@ -22,6 +22,8 @@ export const useCloseOnOutsideClick = createElemPropsHook(usePopupModel)(model =
22
22
  .sort((a, b) => Number(a.style.zIndex) - Number(b.style.zIndex));
23
23
  if (elements.length &&
24
24
  elements[elements.length - 1] === model.state.stackRef.current &&
25
+ // Only consider event targets that are currently in the DOM as valid
26
+ document.contains(event.target) &&
25
27
  // Use `PopupStack.contains` instead of `ref.current.contains` so that the application can
26
28
  // decide if clicking the target should toggle the popup rather than it toggling implicitly
27
29
  // because the target is outside `ref.current`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@workday/canvas-kit-react",
3
- "version": "9.1.34",
3
+ "version": "9.1.36",
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.34",
52
+ "@workday/canvas-kit-popup-stack": "^9.1.36",
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": "205ba18c9c321794966396db0534dbcd7b76fdcb"
69
+ "gitHead": "fd75984b9875504e4db280fe59bea0b4e74c2742"
70
70
  }
@@ -27,6 +27,8 @@ export const useCloseOnOutsideClick = createElemPropsHook(usePopupModel)(model =
27
27
  if (
28
28
  elements.length &&
29
29
  elements[elements.length - 1] === model.state.stackRef.current &&
30
+ // Only consider event targets that are currently in the DOM as valid
31
+ document.contains(event.target as HTMLElement) &&
30
32
  // Use `PopupStack.contains` instead of `ref.current.contains` so that the application can
31
33
  // decide if clicking the target should toggle the popup rather than it toggling implicitly
32
34
  // because the target is outside `ref.current`