MCPcopy Create free account
hub / github.com/caseywebdev/react-list / scrollAround

Method scrollAround

src/react-list.js:456–467  ·  view source on GitHub ↗
(index)

Source from the content-addressed store, hash-verified

454 }
455
456 scrollAround(index) {
457 const current = this.getScrollPosition();
458 const bottom = this.getSpaceBefore(index);
459 const top =
460 bottom -
461 this.props.scrollParentViewportSizeGetter(this) +
462 this.getSizeOfItem(index);
463 const min = Math.min(top, bottom);
464 const max = Math.max(top, bottom);
465 if (current <= min) return this.setScroll(min);
466 if (current > max) return this.setScroll(max);
467 }
468
469 getVisibleRange() {
470 const { from, size } = this.state;

Callers

nothing calls this directly

Calls 4

getScrollPositionMethod · 0.95
getSpaceBeforeMethod · 0.95
getSizeOfItemMethod · 0.95
setScrollMethod · 0.95

Tested by

no test coverage detected