@sanity/ui 2.8.2 → 2.8.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/dist/index.esm.js +4 -4
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +4 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/core/components/breadcrumbs/breadcrumbs.tsx +16 -7
package/dist/index.js
CHANGED
|
@@ -4977,8 +4977,8 @@ const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS = [
|
|
|
4977
4977
|
appearance: none;
|
|
4978
4978
|
margin: -4px;
|
|
4979
4979
|
`, Breadcrumbs = react.forwardRef(function(props, ref) {
|
|
4980
|
-
const { children, maxLength, separator, space: spaceRaw = 2, ...restProps } = props, space = useArrayProp(spaceRaw), [open, setOpen] = react.useState(!1),
|
|
4981
|
-
|
|
4980
|
+
const { children, maxLength, separator, space: spaceRaw = 2, ...restProps } = props, space = useArrayProp(spaceRaw), [open, setOpen] = react.useState(!1), expandElementRef = react.useRef(null), popoverElementRef = react.useRef(null), collapse = react.useCallback(() => setOpen(!1), []), expand = react.useCallback(() => setOpen(!0), []);
|
|
4981
|
+
useClickOutsideEvent(collapse, () => [expandElementRef.current, popoverElementRef.current]);
|
|
4982
4982
|
const rawItems = react.useMemo(() => react.Children.toArray(children).filter(react.isValidElement), [children]), items = react.useMemo(() => {
|
|
4983
4983
|
const len = rawItems.length;
|
|
4984
4984
|
if (maxLength && len > maxLength) {
|
|
@@ -4993,7 +4993,7 @@ const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS = [
|
|
|
4993
4993
|
open,
|
|
4994
4994
|
placement: "top",
|
|
4995
4995
|
portal: !0,
|
|
4996
|
-
ref:
|
|
4996
|
+
ref: popoverElementRef,
|
|
4997
4997
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4998
4998
|
ExpandButton,
|
|
4999
4999
|
{
|
|
@@ -5001,7 +5001,7 @@ const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS = [
|
|
|
5001
5001
|
mode: "bleed",
|
|
5002
5002
|
onClick: open ? collapse : expand,
|
|
5003
5003
|
padding: 1,
|
|
5004
|
-
ref:
|
|
5004
|
+
ref: expandElementRef,
|
|
5005
5005
|
selected: open,
|
|
5006
5006
|
text: "\u2026"
|
|
5007
5007
|
}
|