Example #1
0
 ensureVisible() {
   if (this.props.isActive) {
     // use polyfill as so far only chrome supports this functionality
     scrollIntoViewIfNeeded(this.comment, {
       block: "center",
       scrollMode: "if-needed",
       boundary: document.body,
     });
   }
 }
Example #2
0
 ensureVisible() {
   // Only scroll to this tree if this is the active tree and there is no active comment to scroll to
   if (
     this.props.tree.treeId === this.props.skeletonTracing.activeTreeId &&
     !this.activeNodeHasComment()
   ) {
     scrollIntoViewIfNeeded(this.treeDomElement, {
       block: "center",
       scrollMode: "if-needed",
       boundary: document.body,
     });
   }
 }
Example #3
0
 useEffect(() => {
   if (props.isOpen) {
     console.log(`scroll ${props.label} into view`);
     scrollIntoView(containerRef.current, { block: 'nearest', scrollMode: 'if-needed' });
   }
 });