@kaizen/components 1.79.8 → 1.79.9

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.
@@ -99,21 +99,19 @@ var GenericModal = function (_a) {
99
99
  document.addEventListener('keyup', escapeKeyHandler);
100
100
  }
101
101
  };
102
- var cleanUpAfterClose = function () {
102
+ var cleanUpAfterClose = React.useCallback(function () {
103
103
  if (!isClientReady) return;
104
104
  document.documentElement.classList.remove(GenericModal_module.unscrollable, GenericModal_module.pseudoScrollbar);
105
105
  if (onEscapeKeyup) {
106
106
  document.removeEventListener('keyup', escapeKeyHandler);
107
107
  }
108
- };
108
+ }, [escapeKeyHandler, onEscapeKeyup, isClientReady]);
109
109
  /* Ensure sure add-on styles (e.g. unscrollable) and key event is cleaned up when the modal is unmounted*/
110
- // @todo: Fix if possible - avoiding breaking in eslint upgrade
111
- // eslint-disable-next-line react-hooks/exhaustive-deps
112
110
  React.useEffect(function () {
113
111
  return function () {
114
112
  return cleanUpAfterClose();
115
113
  };
116
- }, []);
114
+ }, [cleanUpAfterClose]);
117
115
  var onAfterLeaveHandler = function () {
118
116
  cleanUpAfterClose();
119
117
  propsOnAfterLeave === null || propsOnAfterLeave === void 0 ? void 0 : propsOnAfterLeave();
@@ -90,21 +90,19 @@ const GenericModal = /*#__PURE__*/function () {
90
90
  document.addEventListener('keyup', escapeKeyHandler);
91
91
  }
92
92
  };
93
- var cleanUpAfterClose = function () {
93
+ var cleanUpAfterClose = useCallback(function () {
94
94
  if (!isClientReady) return;
95
95
  document.documentElement.classList.remove(styles.unscrollable, styles.pseudoScrollbar);
96
96
  if (onEscapeKeyup) {
97
97
  document.removeEventListener('keyup', escapeKeyHandler);
98
98
  }
99
- };
99
+ }, [escapeKeyHandler, onEscapeKeyup, isClientReady]);
100
100
  /* Ensure sure add-on styles (e.g. unscrollable) and key event is cleaned up when the modal is unmounted*/
101
- // @todo: Fix if possible - avoiding breaking in eslint upgrade
102
- // eslint-disable-next-line react-hooks/exhaustive-deps
103
101
  useEffect(function () {
104
102
  return function () {
105
103
  return cleanUpAfterClose();
106
104
  };
107
- }, []);
105
+ }, [cleanUpAfterClose]);
108
106
  var onAfterLeaveHandler = function () {
109
107
  cleanUpAfterClose();
110
108
  propsOnAfterLeave === null || propsOnAfterLeave === void 0 ? void 0 : propsOnAfterLeave();