@deque/cauldron-react 6.20.2-canary.c318fe17 → 6.20.2-canary.cac04a73

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.
Files changed (2) hide show
  1. package/lib/index.js +8 -8
  2. package/package.json +1 -1
package/lib/index.js CHANGED
@@ -4623,25 +4623,25 @@ var Popover = React.forwardRef(function (_a, ref) {
4623
4623
  targetElement === null || targetElement === void 0 ? void 0 : targetElement.setAttribute('aria-haspopup', 'true');
4624
4624
  }
4625
4625
  }, [targetElement, id, show]);
4626
- var handleClickOutside = function (e) {
4626
+ var handleClosePopover = function () {
4627
+ isolator === null || isolator === void 0 ? void 0 : isolator.deactivate();
4628
+ if (show) {
4629
+ onClose();
4630
+ }
4631
+ };
4632
+ var handleClickOutside = React.useCallback(function (e) {
4627
4633
  if (e.target === targetElement) {
4628
4634
  return;
4629
4635
  }
4630
4636
  if (show) {
4631
4637
  handleClosePopover();
4632
4638
  }
4633
- };
4639
+ }, [show, targetElement, handleClosePopover]);
4634
4640
  var attachIsolator = function () {
4635
4641
  if (popoverRef === null || popoverRef === void 0 ? void 0 : popoverRef.current) {
4636
4642
  setIsolator(new AriaIsolate(popoverRef === null || popoverRef === void 0 ? void 0 : popoverRef.current));
4637
4643
  }
4638
4644
  };
4639
- var handleClosePopover = function () {
4640
- isolator === null || isolator === void 0 ? void 0 : isolator.deactivate();
4641
- if (show) {
4642
- onClose();
4643
- }
4644
- };
4645
4645
  useEscapeKey({
4646
4646
  callback: handleClosePopover,
4647
4647
  active: show
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deque/cauldron-react",
3
- "version": "6.20.2-canary.c318fe17",
3
+ "version": "6.20.2-canary.cac04a73",
4
4
  "license": "MPL-2.0",
5
5
  "description": "Fully accessible react components library for Deque Cauldron",
6
6
  "homepage": "https://cauldron.dequelabs.com/",