edvoyui-component-library-test-flight 0.0.222 → 0.0.223

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.
@@ -620,7 +620,7 @@ const offsetValue = computed(() => props.customOffset);
620
620
 
621
621
  const withPopper = (
622
622
  dropdownList: HTMLElement,
623
- component: { $refs: { toggle: Element | VirtualElement } },
623
+ component: { $refs: { toggle: Element | VirtualElement }; open: boolean },
624
624
  { width, maxHeight }: any,
625
625
  ) => {
626
626
  const newwidth = selectWidth.value || width; //setcustom width '400px'
@@ -645,7 +645,23 @@ const withPopper = (
645
645
  ],
646
646
  });
647
647
  dropdownList.classList.add("toggle-dropdown");
648
- return () => popper.destroy();
648
+
649
+ // The dropdown is appended to <body>, so it only tracks its trigger via
650
+ // Popper's rAF-scheduled scroll listener, which visibly lags the trigger
651
+ // during a fast/continuous scroll of an ancestor container until scrolling
652
+ // stops. Closing immediately on any outside scroll (capture phase catches
653
+ // non-bubbling scroll events from nested containers) avoids that detached,
654
+ // floating state entirely.
655
+ const closeOnScroll = (event: Event) => {
656
+ if (dropdownList.contains(event.target as Node)) return;
657
+ component.open = false;
658
+ };
659
+ document.addEventListener("scroll", closeOnScroll, true);
660
+
661
+ return () => {
662
+ document.removeEventListener("scroll", closeOnScroll, true);
663
+ popper.destroy();
664
+ };
649
665
  };
650
666
 
651
667
  const fuseSearch = (