@jsenv/navi 0.29.228 → 0.29.229

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.
@@ -65660,52 +65660,59 @@ const ListContent = ({
65660
65660
  children
65661
65661
  }) => {
65662
65662
  const listProps = useContext(BoxForwardedPropsContext);
65663
- return jsx(Box, {
65664
- className: "navi_list_scroll_container",
65665
- overflow: overflow,
65666
- overflowX: overflowX,
65667
- overflowY: overflowY,
65668
- ...scrollBoxPaddingProps,
65669
- children: jsx(UnorderedList, {
65670
- role: role,
65671
- fallback: fallback,
65672
- fallbackShown: fallbackShown,
65673
- searchFallback: searchFallback,
65674
- searchFallbackShown: searchFallbackShown,
65675
- loadingPlaceholderShown: loadingPlaceholderShown,
65676
- error: error,
65677
- searchNoMatchMode: searchNoMatchMode,
65678
- separator: separator,
65679
- itemTransition: itemTransition,
65680
- expandX: expandX
65681
- // Deliberately not expandY here (unlike expandX above): the outer
65682
- // .navi_list_container already gets its own expandY treatment (see
65683
- // ListUI's own Box above) to fill whatever space its *own* parent
65684
- // gives it (e.g. a flex-column ancestor's flex-grow) — the <ul>
65685
- // itself must stay auto-height regardless, or it gets capped to
65686
- // match .navi_list_scroll_container's own (possibly much smaller)
65687
- // flex-resolved height instead of its real content height. That
65688
- // breaks two things at once: virtual scroll's own filler sizing
65689
- // (nothing to overflow into the scroll container in the first
65690
- // place) and any sticky List.Item header/footer inside it (their
65691
- // sticky "containing block" — the <ul>'s own box — would be
65692
- // artificially small, so they run out of room to stay stuck well
65693
- // before the user has actually scrolled through all the content).
65694
- ,
65695
- horizontal: horizontal,
65696
- spacing: spacing,
65697
- columns: columns,
65698
- itemColumns: itemColumns,
65699
- ...listProps,
65700
- tracker: tracker,
65701
- renderWindow: renderWindow,
65702
- virtual: virtual,
65703
- children: jsx(PendingScrollRefContext.Provider, {
65704
- value: pendingScrollRef,
65705
- children: children
65663
+ return (
65664
+ // Every provider the list puts around its items stands OUTSIDE the <ul>:
65665
+ // the walk that gives the rows their places (see ListDeclaredChildren) is
65666
+ // over the <ul>'s children, and one component between it and the caller's
65667
+ // rows is one child — all the rows would then stand in a single slot, and
65668
+ // reordering them would move nothing.
65669
+ jsx(PendingScrollRefContext.Provider, {
65670
+ value: pendingScrollRef,
65671
+ children: jsx(Box, {
65672
+ className: "navi_list_scroll_container",
65673
+ overflow: overflow,
65674
+ overflowX: overflowX,
65675
+ overflowY: overflowY,
65676
+ ...scrollBoxPaddingProps,
65677
+ children: jsx(UnorderedList, {
65678
+ role: role,
65679
+ fallback: fallback,
65680
+ fallbackShown: fallbackShown,
65681
+ searchFallback: searchFallback,
65682
+ searchFallbackShown: searchFallbackShown,
65683
+ loadingPlaceholderShown: loadingPlaceholderShown,
65684
+ error: error,
65685
+ searchNoMatchMode: searchNoMatchMode,
65686
+ separator: separator,
65687
+ itemTransition: itemTransition,
65688
+ expandX: expandX
65689
+ // Deliberately not expandY here (unlike expandX above): the outer
65690
+ // .navi_list_container already gets its own expandY treatment (see
65691
+ // ListUI's own Box above) to fill whatever space its *own* parent
65692
+ // gives it (e.g. a flex-column ancestor's flex-grow) — the <ul>
65693
+ // itself must stay auto-height regardless, or it gets capped to
65694
+ // match .navi_list_scroll_container's own (possibly much smaller)
65695
+ // flex-resolved height instead of its real content height. That
65696
+ // breaks two things at once: virtual scroll's own filler sizing
65697
+ // (nothing to overflow into the scroll container in the first
65698
+ // place) and any sticky List.Item header/footer inside it (their
65699
+ // sticky "containing block" — the <ul>'s own box — would be
65700
+ // artificially small, so they run out of room to stay stuck well
65701
+ // before the user has actually scrolled through all the content).
65702
+ ,
65703
+ horizontal: horizontal,
65704
+ spacing: spacing,
65705
+ columns: columns,
65706
+ itemColumns: itemColumns,
65707
+ ...listProps,
65708
+ tracker: tracker,
65709
+ renderWindow: renderWindow,
65710
+ virtual: virtual,
65711
+ children: children
65712
+ })
65706
65713
  })
65707
65714
  })
65708
- });
65715
+ );
65709
65716
  };
65710
65717
  // Where the items sit is a question about the track (the <ul>), not about the
65711
65718
  // frame around it: the frame's only child is the scroll box, which fills it and
@@ -65910,17 +65917,14 @@ const useListScrollSync = ({
65910
65917
  item
65911
65918
  });
65912
65919
  };
65913
- const {
65914
- start,
65915
- end
65916
- } = renderWindowRef.current;
65917
- const isInWindow = index >= start && index < end;
65918
- if (isInWindow) {
65919
- const itemEl = findRowElement(getListEl(), item.id);
65920
- if (itemEl) {
65921
- scrollItemIntoView(itemEl);
65922
- return;
65923
- }
65920
+
65921
+ // Whether the row is drawn is asked of the dom, not of the render window:
65922
+ // the window says what a run draws, and a list whose rows are declared one
65923
+ // by one has them all in the dom whatever the window says.
65924
+ const itemEl = findRowElement(getListEl(), item.id);
65925
+ if (itemEl) {
65926
+ scrollItemIntoView(itemEl);
65927
+ return;
65924
65928
  }
65925
65929
  // Not in DOM — shift the render window. The item will read
65926
65930
  // pendingScrollRef on mount and scroll into view.
@@ -66042,9 +66046,8 @@ const useListScrollSync = ({
66042
66046
  }, []);
66043
66047
  // Watch scores of the top renderBudget items.
66044
66048
  // When scores change during an active search, scroll to top to reveal the most relevant items.
66045
- // When search becomes empty, restore the scroll position from before the search started.
66046
- // We save the first-visible item ID so restoration is item-precise
66047
- // and survives render-window shifts or item reordering.
66049
+ // When search becomes empty, put the list back at the offset (and the render
66050
+ // window) it was at when the search started — see docs/scroll.md.
66048
66051
 
66049
66052
  // NOTE POUR LE JOUR OU ON A LE MULTISELECT:
66050
66053
  // Lorsqu'on selectionne quelque chose pendant une recherche, alors ensuite meme si on clear