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

Method setScroll

src/react-list.js:206–214  ·  view source on GitHub ↗
(offset)

Source from the content-addressed store, hash-verified

204 }
205
206 setScroll(offset) {
207 const { scrollParent } = this;
208 const { axis } = this.props;
209 offset += this.getOffset(this.getEl());
210 if (scrollParent === window) return window.scrollTo(0, offset);
211
212 offset -= this.getOffset(this.scrollParent);
213 scrollParent[SCROLL_START_KEYS[axis]] = offset;
214 }
215
216 getScrollSize() {
217 const { scrollParent } = this;

Callers 4

scrollToMethod · 0.95
scrollAroundMethod · 0.95
react-list.jsFile · 0.80
index.jsFile · 0.80

Calls 3

getOffsetMethod · 0.95
getElMethod · 0.95
scrollToMethod · 0.80

Tested by

no test coverage detected