@jupyterlab/ui-components 4.6.4 → 4.6.6

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.
@@ -1302,6 +1302,24 @@ export class WindowedList<
1302
1302
  const { clientHeight, scrollHeight, scrollTop } =
1303
1303
  event.currentTarget as HTMLDivElement;
1304
1304
 
1305
+ // A scroll that the list did not request, such as one with the mouse
1306
+ // wheel, stops the list from scrolling back to the last requested
1307
+ // item. The type check excludes the synthetic onScroll call made
1308
+ // when windowing is toggled, which carries no event type.
1309
+ // When the list requests an offset past the end (such as the last
1310
+ // item plus a margin), the browser scrolls only to the end, so the
1311
+ // comparison limits the offset to the end.
1312
+ if (
1313
+ event.type === 'scroll' &&
1314
+ !this._scrollUpdateWasRequested &&
1315
+ Math.abs(
1316
+ Math.min(this.viewModel.scrollOffset, scrollHeight - clientHeight) -
1317
+ scrollTop
1318
+ ) > 1
1319
+ ) {
1320
+ this._scrollToItem = null;
1321
+ }
1322
+
1305
1323
  // TBC Firefox is emitting two events one with 1px diff then the _real_ scroll
1306
1324
  if (
1307
1325
  !this._scrollUpdateWasRequested &&