a tool for shared writing and social publishing

oops console logs

-6
-6
src/utils/scrollIntoViewIfNeeded.ts
··· 4 behavior?: ScrollBehavior, 5 rootBottomMargin?: number, 6 ) { 7 - console.log("this should scroll up now!"); 8 - 9 if (!el) { 10 return; 11 } ··· 31 let scrollContainer = getScrollParent(el); 32 let scrollContainerHeight = scrollContainer.clientHeight; 33 let distanceFromBottom = scrollContainerHeight - rect.bottom; 34 - 35 - console.log("containerHeight: " + scrollContainerHeight); 36 - console.log("el bottom: " + rect.bottom); 37 - 38 scrollContainer.scrollBy({ 39 top: Math.abs(rootBottomMargin + distanceFromBottom), 40 behavior: behavior ? behavior : "auto",
··· 4 behavior?: ScrollBehavior, 5 rootBottomMargin?: number, 6 ) { 7 if (!el) { 8 return; 9 } ··· 29 let scrollContainer = getScrollParent(el); 30 let scrollContainerHeight = scrollContainer.clientHeight; 31 let distanceFromBottom = scrollContainerHeight - rect.bottom; 32 scrollContainer.scrollBy({ 33 top: Math.abs(rootBottomMargin + distanceFromBottom), 34 behavior: behavior ? behavior : "auto",