react-ui-suite 1.1.5 → 1.1.6
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 +9 -4
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1866,6 +1866,7 @@ function Select({
|
|
|
1866
1866
|
const containerRef = React11.useRef(null);
|
|
1867
1867
|
const inputRef = React11.useRef(null);
|
|
1868
1868
|
const chevronRef = React11.useRef(null);
|
|
1869
|
+
const popoverRef = React11.useRef(null);
|
|
1869
1870
|
const popoverListRef = React11.useRef(null);
|
|
1870
1871
|
const suppressToggleRef = React11.useRef(false);
|
|
1871
1872
|
const id = React11.useId();
|
|
@@ -1885,10 +1886,14 @@ function Select({
|
|
|
1885
1886
|
);
|
|
1886
1887
|
const activeIndex = activeIndexState;
|
|
1887
1888
|
const [selected, setSelected] = useControlledState(value, defaultValue != null ? defaultValue : null);
|
|
1888
|
-
|
|
1889
|
-
[
|
|
1890
|
-
|
|
1889
|
+
const outsideClickRefs = React11.useMemo(
|
|
1890
|
+
() => [
|
|
1891
|
+
containerRef,
|
|
1892
|
+
popoverRef
|
|
1893
|
+
],
|
|
1894
|
+
[]
|
|
1891
1895
|
);
|
|
1896
|
+
useOutsideClick(outsideClickRefs, () => setOpen(false));
|
|
1892
1897
|
const selectedOption = (_a = options.find((opt) => opt.value === selected)) != null ? _a : null;
|
|
1893
1898
|
const selectedIndex = React11.useMemo(
|
|
1894
1899
|
() => options.findIndex((opt) => opt.value === selected),
|
|
@@ -2055,7 +2060,7 @@ function Select({
|
|
|
2055
2060
|
}
|
|
2056
2061
|
setOpen((o) => !o);
|
|
2057
2062
|
},
|
|
2058
|
-
children: open && /* @__PURE__ */ jsx13(Popover, { anchorRef: containerRef, className: listboxHighlight, children: ({ scrollRef }) => {
|
|
2063
|
+
children: open && /* @__PURE__ */ jsx13(Popover, { anchorRef: containerRef, rootRef: popoverRef, className: listboxHighlight, children: ({ scrollRef }) => {
|
|
2059
2064
|
popoverListRef.current = scrollRef;
|
|
2060
2065
|
return /* @__PURE__ */ jsx13(
|
|
2061
2066
|
"ul",
|