@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.
@@ -64960,52 +64960,59 @@ const ListContent = ({
64960
64960
  children
64961
64961
  }) => {
64962
64962
  const listProps = useContext(BoxForwardedPropsContext);
64963
- return jsx(Box, {
64964
- className: "navi_list_scroll_container",
64965
- overflow: overflow,
64966
- overflowX: overflowX,
64967
- overflowY: overflowY,
64968
- ...scrollBoxPaddingProps,
64969
- children: jsx(UnorderedList, {
64970
- role: role,
64971
- fallback: fallback,
64972
- fallbackShown: fallbackShown,
64973
- searchFallback: searchFallback,
64974
- searchFallbackShown: searchFallbackShown,
64975
- loadingPlaceholderShown: loadingPlaceholderShown,
64976
- error: error,
64977
- searchNoMatchMode: searchNoMatchMode,
64978
- separator: separator,
64979
- itemTransition: itemTransition,
64980
- expandX: expandX
64981
- // Deliberately not expandY here (unlike expandX above): the outer
64982
- // .navi_list_container already gets its own expandY treatment (see
64983
- // ListUI's own Box above) to fill whatever space its *own* parent
64984
- // gives it (e.g. a flex-column ancestor's flex-grow) — the <ul>
64985
- // itself must stay auto-height regardless, or it gets capped to
64986
- // match .navi_list_scroll_container's own (possibly much smaller)
64987
- // flex-resolved height instead of its real content height. That
64988
- // breaks two things at once: virtual scroll's own filler sizing
64989
- // (nothing to overflow into the scroll container in the first
64990
- // place) and any sticky List.Item header/footer inside it (their
64991
- // sticky "containing block" — the <ul>'s own box — would be
64992
- // artificially small, so they run out of room to stay stuck well
64993
- // before the user has actually scrolled through all the content).
64994
- ,
64995
- horizontal: horizontal,
64996
- spacing: spacing,
64997
- columns: columns,
64998
- itemColumns: itemColumns,
64999
- ...listProps,
65000
- tracker: tracker,
65001
- renderWindow: renderWindow,
65002
- virtual: virtual,
65003
- children: jsx(PendingScrollRefContext.Provider, {
65004
- value: pendingScrollRef,
65005
- children: children
64963
+ return (
64964
+ // Every provider the list puts around its items stands OUTSIDE the <ul>:
64965
+ // the walk that gives the rows their places (see ListDeclaredChildren) is
64966
+ // over the <ul>'s children, and one component between it and the caller's
64967
+ // rows is one child — all the rows would then stand in a single slot, and
64968
+ // reordering them would move nothing.
64969
+ jsx(PendingScrollRefContext.Provider, {
64970
+ value: pendingScrollRef,
64971
+ children: jsx(Box, {
64972
+ className: "navi_list_scroll_container",
64973
+ overflow: overflow,
64974
+ overflowX: overflowX,
64975
+ overflowY: overflowY,
64976
+ ...scrollBoxPaddingProps,
64977
+ children: jsx(UnorderedList, {
64978
+ role: role,
64979
+ fallback: fallback,
64980
+ fallbackShown: fallbackShown,
64981
+ searchFallback: searchFallback,
64982
+ searchFallbackShown: searchFallbackShown,
64983
+ loadingPlaceholderShown: loadingPlaceholderShown,
64984
+ error: error,
64985
+ searchNoMatchMode: searchNoMatchMode,
64986
+ separator: separator,
64987
+ itemTransition: itemTransition,
64988
+ expandX: expandX
64989
+ // Deliberately not expandY here (unlike expandX above): the outer
64990
+ // .navi_list_container already gets its own expandY treatment (see
64991
+ // ListUI's own Box above) to fill whatever space its *own* parent
64992
+ // gives it (e.g. a flex-column ancestor's flex-grow) — the <ul>
64993
+ // itself must stay auto-height regardless, or it gets capped to
64994
+ // match .navi_list_scroll_container's own (possibly much smaller)
64995
+ // flex-resolved height instead of its real content height. That
64996
+ // breaks two things at once: virtual scroll's own filler sizing
64997
+ // (nothing to overflow into the scroll container in the first
64998
+ // place) and any sticky List.Item header/footer inside it (their
64999
+ // sticky "containing block" — the <ul>'s own box — would be
65000
+ // artificially small, so they run out of room to stay stuck well
65001
+ // before the user has actually scrolled through all the content).
65002
+ ,
65003
+ horizontal: horizontal,
65004
+ spacing: spacing,
65005
+ columns: columns,
65006
+ itemColumns: itemColumns,
65007
+ ...listProps,
65008
+ tracker: tracker,
65009
+ renderWindow: renderWindow,
65010
+ virtual: virtual,
65011
+ children: children
65012
+ })
65006
65013
  })
65007
65014
  })
65008
- });
65015
+ );
65009
65016
  };
65010
65017
  // Where the items sit is a question about the track (the <ul>), not about the
65011
65018
  // frame around it: the frame's only child is the scroll box, which fills it and
@@ -65210,17 +65217,14 @@ const useListScrollSync = ({
65210
65217
  item
65211
65218
  });
65212
65219
  };
65213
- const {
65214
- start,
65215
- end
65216
- } = renderWindowRef.current;
65217
- const isInWindow = index >= start && index < end;
65218
- if (isInWindow) {
65219
- const itemEl = findRowElement(getListEl(), item.id);
65220
- if (itemEl) {
65221
- scrollItemIntoView(itemEl);
65222
- return;
65223
- }
65220
+
65221
+ // Whether the row is drawn is asked of the dom, not of the render window:
65222
+ // the window says what a run draws, and a list whose rows are declared one
65223
+ // by one has them all in the dom whatever the window says.
65224
+ const itemEl = findRowElement(getListEl(), item.id);
65225
+ if (itemEl) {
65226
+ scrollItemIntoView(itemEl);
65227
+ return;
65224
65228
  }
65225
65229
  // Not in DOM — shift the render window. The item will read
65226
65230
  // pendingScrollRef on mount and scroll into view.
@@ -65342,9 +65346,8 @@ const useListScrollSync = ({
65342
65346
  }, []);
65343
65347
  // Watch scores of the top renderBudget items.
65344
65348
  // When scores change during an active search, scroll to top to reveal the most relevant items.
65345
- // When search becomes empty, restore the scroll position from before the search started.
65346
- // We save the first-visible item ID so restoration is item-precise
65347
- // and survives render-window shifts or item reordering.
65349
+ // When search becomes empty, put the list back at the offset (and the render
65350
+ // window) it was at when the search started — see docs/scroll.md.
65348
65351
 
65349
65352
  // NOTE POUR LE JOUR OU ON A LE MULTISELECT:
65350
65353
  // Lorsqu'on selectionne quelque chose pendant une recherche, alors ensuite meme si on clear