@sledge-app/react-instant-search 2.0.9 → 2.0.10

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.
@@ -692,14 +692,18 @@ const Popover = ({
692
692
  alignOffset = 0
693
693
  }) => {
694
694
  const [open, setOpen] = React__default.useState(withOpenState ? isOpen : false);
695
- React__default.useEffect(() => {
696
- var _a;
697
- let arrowElement = (_a = document == null ? void 0 : document.querySelector(".PopoverArrow")) == null ? void 0 : _a.parentElement;
695
+ const popoverContentRef = React__default.useRef(null);
696
+ const handleCustomArrow = () => {
697
+ var _a, _b;
698
+ const popoverContentRefCurrent = popoverContentRef == null ? void 0 : popoverContentRef.current;
699
+ if (!popoverContentRefCurrent)
700
+ return;
701
+ let arrowElement = (_b = (_a = popoverContentRefCurrent == null ? void 0 : popoverContentRefCurrent.querySelector) == null ? void 0 : _a.call(popoverContentRefCurrent, ".PopoverArrow")) == null ? void 0 : _b.parentElement;
698
702
  if (arrowElement && (customArrow == null ? void 0 : customArrow.length)) {
699
703
  arrowElement.style.display = "inline-flex";
700
704
  arrowElement.innerHTML = customArrow;
701
705
  }
702
- }, [open]);
706
+ };
703
707
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(
704
708
  $cb5cc270b50c6fcd$export$be92b6f5f03c0fe9,
705
709
  {
@@ -721,8 +725,12 @@ const Popover = ({
721
725
  sideOffset,
722
726
  alignOffset,
723
727
  align,
728
+ ref: popoverContentRef,
724
729
  ...setIsOpen && {
725
- onOpenAutoFocus: () => setIsOpen(true),
730
+ onOpenAutoFocus: () => {
731
+ setIsOpen(true);
732
+ handleCustomArrow();
733
+ },
726
734
  onCloseAutoFocus: () => setIsOpen(false)
727
735
  },
728
736
  children: [