@coreui/react 4.9.0 → 4.9.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/index.js CHANGED
@@ -5985,10 +5985,12 @@ var CModal = React.forwardRef(function (_a, ref) {
5985
5985
  setVisible(visible);
5986
5986
  }, [visible]);
5987
5987
  React.useEffect(function () {
5988
- document.addEventListener('click', handleClickOutside);
5989
- document.addEventListener('keydown', handleKeyDown);
5988
+ if (_visible) {
5989
+ document.addEventListener('mouseup', handleClickOutside);
5990
+ document.addEventListener('keydown', handleKeyDown);
5991
+ }
5990
5992
  return function () {
5991
- document.removeEventListener('click', handleClickOutside);
5993
+ document.removeEventListener('mouseup', handleClickOutside);
5992
5994
  document.removeEventListener('keydown', handleKeyDown);
5993
5995
  };
5994
5996
  }, [_visible]);