@lumx/react 4.11.0-alpha.2 → 4.11.0-alpha.3
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/index.js +13 -13
- package/index.js.map +1 -1
- package/package.json +3 -3
package/index.js
CHANGED
|
@@ -6100,6 +6100,12 @@ function useEventCallback(fn) {
|
|
|
6100
6100
|
return React__default.useCallback((...args) => ref.current?.(...args), []);
|
|
6101
6101
|
}
|
|
6102
6102
|
|
|
6103
|
+
/** Unref a react ref or element */
|
|
6104
|
+
function unref(maybeElement) {
|
|
6105
|
+
if (maybeElement instanceof HTMLElement) return maybeElement;
|
|
6106
|
+
return maybeElement?.current;
|
|
6107
|
+
}
|
|
6108
|
+
|
|
6103
6109
|
const useRovingTabIndexContainer = ({
|
|
6104
6110
|
containerRef,
|
|
6105
6111
|
itemSelector,
|
|
@@ -6110,7 +6116,7 @@ const useRovingTabIndexContainer = ({
|
|
|
6110
6116
|
}) => {
|
|
6111
6117
|
const onItemFocused = useEventCallback(unstableOnItemFocused);
|
|
6112
6118
|
useIsomorphicLayoutEffect(() => {
|
|
6113
|
-
const container = containerRef
|
|
6119
|
+
const container = unref(containerRef);
|
|
6114
6120
|
if (!container) {
|
|
6115
6121
|
return undefined;
|
|
6116
6122
|
}
|
|
@@ -6151,7 +6157,7 @@ const SelectionChipGroup = ({
|
|
|
6151
6157
|
chipRemoveLabel,
|
|
6152
6158
|
...forwardedProps
|
|
6153
6159
|
}) => {
|
|
6154
|
-
const
|
|
6160
|
+
const [container, setContainer] = React__default.useState(null);
|
|
6155
6161
|
|
|
6156
6162
|
// Store latest values in refs so the event handlers always access current state.
|
|
6157
6163
|
const valueRef = React__default.useRef(value);
|
|
@@ -6159,18 +6165,18 @@ const SelectionChipGroup = ({
|
|
|
6159
6165
|
const onChangeRef = React__default.useRef(onChange);
|
|
6160
6166
|
onChangeRef.current = onChange;
|
|
6161
6167
|
|
|
6162
|
-
// Attach event listeners
|
|
6168
|
+
// Attach event listeners. Re-runs when the container mounts/unmounts, inputRef or getOptionId change.
|
|
6163
6169
|
React__default.useEffect(() => {
|
|
6164
6170
|
return setupSelectionChipGroupEvents({
|
|
6165
|
-
getContainer: () =>
|
|
6171
|
+
getContainer: () => container,
|
|
6166
6172
|
getInput: () => inputRef?.current,
|
|
6167
6173
|
onChange: newValue => onChangeRef.current?.(newValue),
|
|
6168
6174
|
getValue: () => valueRef.current,
|
|
6169
6175
|
getOptionId
|
|
6170
6176
|
});
|
|
6171
|
-
}, [inputRef, getOptionId]);
|
|
6177
|
+
}, [container, inputRef, getOptionId]);
|
|
6172
6178
|
useRovingTabIndexContainer({
|
|
6173
|
-
containerRef,
|
|
6179
|
+
containerRef: container,
|
|
6174
6180
|
itemSelector: `.${CLASSNAME$1i}`,
|
|
6175
6181
|
itemDisabledSelector: `.${CLASSNAME$1i}[aria-disabled="true"]`
|
|
6176
6182
|
});
|
|
@@ -6203,7 +6209,7 @@ const SelectionChipGroup = ({
|
|
|
6203
6209
|
label,
|
|
6204
6210
|
chipRemoveLabel,
|
|
6205
6211
|
getChipProps,
|
|
6206
|
-
ref:
|
|
6212
|
+
ref: setContainer
|
|
6207
6213
|
}, {
|
|
6208
6214
|
Chip,
|
|
6209
6215
|
ChipGroup,
|
|
@@ -13562,12 +13568,6 @@ const ImageSlideshow = ({
|
|
|
13562
13568
|
});
|
|
13563
13569
|
};
|
|
13564
13570
|
|
|
13565
|
-
/** Unref a react ref or element */
|
|
13566
|
-
function unref(maybeElement) {
|
|
13567
|
-
if (maybeElement instanceof HTMLElement) return maybeElement;
|
|
13568
|
-
return maybeElement?.current;
|
|
13569
|
-
}
|
|
13570
|
-
|
|
13571
13571
|
function setupViewTransitionName(elementRef, name) {
|
|
13572
13572
|
let originalName = null;
|
|
13573
13573
|
return {
|