MCPcopy Create free account
hub / github.com/microsoft/SandDance / scrollSnapshotIntoView

Method scrollSnapshotIntoView

docs/app/js/sanddance-app.js:14547–14557  ·  view source on GitHub ↗
(selectedSnapshotIndex)

Source from the content-addressed store, hash-verified

14545 this.props.onSnapshotsChanged && this.props.onSnapshotsChanged(snapshots);
14546 }
14547 scrollSnapshotIntoView(selectedSnapshotIndex) {
14548 clearTimeout(this.scrollSnapshotTimer);
14549 if (this.state.sidebarClosed) return;
14550 this.scrollSnapshotTimer = setTimeout(()=>{
14551 const selectedSnapshotElement = this.div.querySelector(`.snapshot:nth-child(${selectedSnapshotIndex + 1})`);
14552 if (selectedSnapshotElement) selectedSnapshotElement.scrollIntoView({
14553 behavior: "smooth",
14554 block: "nearest"
14555 });
14556 }, 500);
14557 }
14558 componentDidMount() {
14559 if (this.props.mounted) this.props.mounted(this);
14560 }

Callers 3

reviveSnapshotMethod · 0.95
writeSnapshotMethod · 0.95
hydrateSnapshotMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected