Skip to content

Commit 0b4aea6

Browse files
authored
Create a new dist version 2.2.1 (#320)
Collecting: - Fix [UI] UI crash when closing pop-up dialogs (#315) - Fix [Chips] Hidden chips block doesn't close (#316) - Tests [UI] Add Initial Workflow to Enable GitHub Actions for Forked Repositories (#319)
1 parent b97f006 commit 0b4aea6

File tree

4 files changed

+30
-27
lines changed

4 files changed

+30
-27
lines changed

commit_message

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11

22

3-
Create a new dist version 2.2.0
3+
Create a new dist version 2.2.1
44

55
Collecting:
6-
- Fix [DRC] Apply ESLint & Prettier Formatting Adjustments (#312)
7-
- Fix [Models endpoints monitoring, metrics] The 'Choose metrics' dropdown is closing unexpectedly (#311)
8-
- Fix [Round Icon] Tooltip doesn't disappear (#313)
6+
- Fix [UI] UI crash when closing pop-up dialogs (#315)
7+
- Fix [Chips] Hidden chips block doesn't close (#316)
8+
- Tests [UI] Add Initial Workflow to Enable GitHub Actions for Forked Repositories (#319)

dist/components/PopUpDialog/PopUpDialog.js

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -114,19 +114,21 @@ const PopUpDialog = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
114114
calculateCustomPopUpPosition();
115115
}, [calculateCustomPopUpPosition]);
116116
(0, _react.useEffect)(() => {
117-
const throttledCalculatedCustomPopUpPosition = (0, _lodash.throttle)(calculateCustomPopUpPosition, 100, {
118-
trailing: true,
119-
leading: true
120-
});
121-
const popupObserver = new ResizeObserver(throttledCalculatedCustomPopUpPosition);
122-
const popupElement = ref.current;
123-
popupObserver.observe(popupElement);
124-
window.addEventListener('resize', throttledCalculatedCustomPopUpPosition);
125-
return () => {
126-
popupObserver.unobserve(popupElement);
127-
window.removeEventListener('resize', throttledCalculatedCustomPopUpPosition);
128-
};
129-
}, [calculateCustomPopUpPosition, ref]);
117+
if (showPopUp) {
118+
const throttledCalculatedCustomPopUpPosition = (0, _lodash.throttle)(calculateCustomPopUpPosition, 100, {
119+
trailing: true,
120+
leading: true
121+
});
122+
const popupObserver = new ResizeObserver(throttledCalculatedCustomPopUpPosition);
123+
const popupElement = ref.current;
124+
popupObserver.observe(popupElement);
125+
window.addEventListener('resize', throttledCalculatedCustomPopUpPosition);
126+
return () => {
127+
popupObserver.unobserve(popupElement);
128+
window.removeEventListener('resize', throttledCalculatedCustomPopUpPosition);
129+
};
130+
}
131+
}, [calculateCustomPopUpPosition, ref, showPopUp]);
130132
return showPopUp ? /*#__PURE__*/(0, _reactDom.createPortal)( /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
131133
ref: ref,
132134
className: popUpClassNames,

dist/hooks/useChipCell.hook.js

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,21 +39,22 @@ const useChipCell = (isEditMode, visibleChipsMaxLength) => {
3939
const hiddenChipsCounterRef = (0, _react.useRef)();
4040
const hiddenChipsPopUpRef = (0, _react.useRef)();
4141
const handleShowElements = (0, _react.useCallback)(event => {
42+
var _hiddenChipsCounterRe2;
4243
if (!isEditMode || isEditMode && visibleChipsMaxLength) {
4344
var _hiddenChipsCounterRe;
44-
if (!((_hiddenChipsCounterRe = hiddenChipsCounterRef.current) !== null && _hiddenChipsCounterRe !== void 0 && _hiddenChipsCounterRe.contains(event.target))) {
45-
setShowHiddenChips(false);
46-
} else {
45+
if ((_hiddenChipsCounterRe = hiddenChipsCounterRef.current) !== null && _hiddenChipsCounterRe !== void 0 && _hiddenChipsCounterRe.contains(event.target) && !showHiddenChips) {
4746
setShowHiddenChips(true);
47+
} else {
48+
setShowHiddenChips(false);
4849
}
4950
}
50-
event && event.stopPropagation();
51-
}, [isEditMode, visibleChipsMaxLength]);
51+
event && ((_hiddenChipsCounterRe2 = hiddenChipsCounterRef.current) === null || _hiddenChipsCounterRe2 === void 0 ? void 0 : _hiddenChipsCounterRe2.contains(event.target)) && event.stopPropagation();
52+
}, [isEditMode, showHiddenChips, visibleChipsMaxLength]);
5253
(0, _react.useEffect)(() => {
5354
if (showHiddenChips) {
54-
window.addEventListener('click', handleShowElements);
55-
return () => window.removeEventListener('click', handleShowElements);
55+
window.addEventListener('click', handleShowElements, true);
5656
}
57+
return () => window.removeEventListener('click', handleShowElements, true);
5758
}, [showHiddenChips, handleShowElements]);
5859
const handleScroll = (0, _react.useCallback)(event => {
5960
if (event.target.parentElement !== (hiddenChipsPopUpRef === null || hiddenChipsPopUpRef === void 0 ? void 0 : hiddenChipsPopUpRef.current)) {
@@ -68,10 +69,10 @@ const useChipCell = (isEditMode, visibleChipsMaxLength) => {
6869
}, [handleScroll, showHiddenChips]);
6970
const resizeChipCell = (0, _react.useCallback)(() => {
7071
if (hiddenChipsPopUpRef !== null && hiddenChipsPopUpRef !== void 0 && hiddenChipsPopUpRef.current) {
71-
var _hiddenChipsCounterRe2;
72+
var _hiddenChipsCounterRe3;
7273
const scrollableParent = (0, _getFirstScrollableParent.getFirstScrollableParent)(hiddenChipsCounterRef.current.offsetParent);
7374
const scrollableParentRect = scrollableParent.getBoundingClientRect();
74-
const hiddenChipsCounterRect = (_hiddenChipsCounterRe2 = hiddenChipsCounterRef.current) === null || _hiddenChipsCounterRe2 === void 0 ? void 0 : _hiddenChipsCounterRe2.getBoundingClientRect();
75+
const hiddenChipsCounterRect = (_hiddenChipsCounterRe3 = hiddenChipsCounterRef.current) === null || _hiddenChipsCounterRe3 === void 0 ? void 0 : _hiddenChipsCounterRe3.getBoundingClientRect();
7576

7677
// Check if the hiddenChipsCounterRect is outside the boundaries of the scrollableParentRect or the window
7778
if (hiddenChipsCounterRect.left < scrollableParentRect.left || hiddenChipsCounterRect.top < scrollableParentRect.top || hiddenChipsCounterRect.right > scrollableParentRect.right || hiddenChipsCounterRect.bottom > scrollableParentRect.bottom || hiddenChipsCounterRect.right > window.innerWidth || hiddenChipsCounterRect.bottom > window.innerHeight) {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "iguazio.dashboard-react-controls",
3-
"version": "2.2.0",
3+
"version": "2.2.1",
44
"description": "Collection of resources (such as CSS styles, fonts and images) and ReactJS 17.x components to share among different Iguazio React repos.",
55
"main": "dist/index.js",
66
"module": "dist/index.js",

0 commit comments

Comments
 (0)