@coreui/react-pro 4.12.1 → 4.12.2

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/index.js CHANGED
@@ -10488,10 +10488,12 @@ var CModal = React$1.forwardRef(function (_a, ref) {
10488
10488
  setVisible(visible);
10489
10489
  }, [visible]);
10490
10490
  React$1.useEffect(function () {
10491
- document.addEventListener('click', handleClickOutside);
10492
- document.addEventListener('keydown', handleKeyDown);
10491
+ if (_visible) {
10492
+ document.addEventListener('mouseup', handleClickOutside);
10493
+ document.addEventListener('keydown', handleKeyDown);
10494
+ }
10493
10495
  return function () {
10494
- document.removeEventListener('click', handleClickOutside);
10496
+ document.removeEventListener('mouseup', handleClickOutside);
10495
10497
  document.removeEventListener('keydown', handleKeyDown);
10496
10498
  };
10497
10499
  }, [_visible]);