@reykjavik/hanna-react 0.10.168 → 0.10.169
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/CHANGELOG.md +10 -0
- package/Multiselect.js +1 -0
- package/_abstract/_AbstractModal.js +7 -11
- package/esm/Multiselect.js +1 -0
- package/esm/_abstract/_AbstractModal.js +7 -11
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,16 @@
|
|
|
4
4
|
|
|
5
5
|
- ... <!-- Add new lines here. -->
|
|
6
6
|
|
|
7
|
+
## 0.10.169
|
|
8
|
+
|
|
9
|
+
_2026-02-24_
|
|
10
|
+
|
|
11
|
+
- `Modal`:
|
|
12
|
+
- fix: Togling `open` prop works unreliably in modern React versions
|
|
13
|
+
- `Multiselect`:
|
|
14
|
+
- fix: Stop `'Escape'` key events bubbling and causing side-effects (e.g.
|
|
15
|
+
closing a parent `Modal`)
|
|
16
|
+
|
|
7
17
|
## 0.10.168
|
|
8
18
|
|
|
9
19
|
_2026-02-23_
|
package/Multiselect.js
CHANGED
|
@@ -82,17 +82,6 @@ const AbstractModal = (props) => {
|
|
|
82
82
|
}, closeDelay);
|
|
83
83
|
}
|
|
84
84
|
};
|
|
85
|
-
// ---
|
|
86
|
-
// Update open state when props.open changes. Icky but simple.
|
|
87
|
-
const lastPropsOpen = (0, react_1.useRef)(openProp);
|
|
88
|
-
if (openProp !== lastPropsOpen.current && openProp !== open) {
|
|
89
|
-
lastPropsOpen.current = openProp;
|
|
90
|
-
// these update state during render, which aborts the current render
|
|
91
|
-
// and triggers an immediate rerender.
|
|
92
|
-
openProp ? openModal() : closeModal();
|
|
93
|
-
}
|
|
94
|
-
lastPropsOpen.current = openProp;
|
|
95
|
-
// ---
|
|
96
85
|
const closeOnCurtainClick = isFickle &&
|
|
97
86
|
((e) => {
|
|
98
87
|
if (e.target === e.currentTarget) {
|
|
@@ -118,6 +107,13 @@ const AbstractModal = (props) => {
|
|
|
118
107
|
return () => removeFromModalStack(privateDomId);
|
|
119
108
|
}, [] // eslint-disable-line react-hooks/exhaustive-deps
|
|
120
109
|
);
|
|
110
|
+
(0, react_1.useEffect)(() => {
|
|
111
|
+
if (openProp === open) {
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
openProp ? openModal() : closeModal();
|
|
115
|
+
}, [openProp] // eslint-disable-line react-hooks/exhaustive-deps
|
|
116
|
+
);
|
|
121
117
|
const PortalOrFragment = props.portal !== false ? _Portal_js_1.Portal : react_1.Fragment;
|
|
122
118
|
const closeButtonLabel = txt.closeButtonLabel || txt.closeButton;
|
|
123
119
|
const { onClick, className } = wrapperProps;
|
package/esm/Multiselect.js
CHANGED
|
@@ -78,17 +78,6 @@ export const AbstractModal = (props) => {
|
|
|
78
78
|
}, closeDelay);
|
|
79
79
|
}
|
|
80
80
|
};
|
|
81
|
-
// ---
|
|
82
|
-
// Update open state when props.open changes. Icky but simple.
|
|
83
|
-
const lastPropsOpen = useRef(openProp);
|
|
84
|
-
if (openProp !== lastPropsOpen.current && openProp !== open) {
|
|
85
|
-
lastPropsOpen.current = openProp;
|
|
86
|
-
// these update state during render, which aborts the current render
|
|
87
|
-
// and triggers an immediate rerender.
|
|
88
|
-
openProp ? openModal() : closeModal();
|
|
89
|
-
}
|
|
90
|
-
lastPropsOpen.current = openProp;
|
|
91
|
-
// ---
|
|
92
81
|
const closeOnCurtainClick = isFickle &&
|
|
93
82
|
((e) => {
|
|
94
83
|
if (e.target === e.currentTarget) {
|
|
@@ -114,6 +103,13 @@ export const AbstractModal = (props) => {
|
|
|
114
103
|
return () => removeFromModalStack(privateDomId);
|
|
115
104
|
}, [] // eslint-disable-line react-hooks/exhaustive-deps
|
|
116
105
|
);
|
|
106
|
+
useEffect(() => {
|
|
107
|
+
if (openProp === open) {
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
openProp ? openModal() : closeModal();
|
|
111
|
+
}, [openProp] // eslint-disable-line react-hooks/exhaustive-deps
|
|
112
|
+
);
|
|
117
113
|
const PortalOrFragment = props.portal !== false ? Portal : Fragment;
|
|
118
114
|
const closeButtonLabel = txt.closeButtonLabel || txt.closeButton;
|
|
119
115
|
const { onClick, className } = wrapperProps;
|