@facter/ds-core 1.14.0 → 1.15.0

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.mjs CHANGED
@@ -3361,6 +3361,23 @@ function CardSelect({
3361
3361
  setTimeout(() => searchRef.current?.focus(), 0);
3362
3362
  }
3363
3363
  }, [open, searchable]);
3364
+ React10.useEffect(() => {
3365
+ const el = listRef.current;
3366
+ if (!el || !open) return;
3367
+ const handleWheel = (e) => {
3368
+ const { scrollTop, scrollHeight, clientHeight } = el;
3369
+ const isScrollable = scrollHeight > clientHeight;
3370
+ if (!isScrollable) return;
3371
+ e.preventDefault();
3372
+ e.stopPropagation();
3373
+ el.scrollTop = Math.max(
3374
+ 0,
3375
+ Math.min(scrollTop + e.deltaY, scrollHeight - clientHeight)
3376
+ );
3377
+ };
3378
+ el.addEventListener("wheel", handleWheel, { passive: false, capture: true });
3379
+ return () => el.removeEventListener("wheel", handleWheel, { capture: true });
3380
+ }, [open, filteredOptions]);
3364
3381
  const handleScroll = React10.useCallback(() => {
3365
3382
  if (!onLoadMore || !hasMore || loading) return;
3366
3383
  const el = listRef.current;