tangled
alpha
login
or
join now
ajamesphillips.com
/
leaflet
forked from
leaflet.pub/leaflet
a tool for shared writing and social publishing
0
fork
atom
overview
issues
pulls
pipelines
oops console logs
cozylittle.house
2 months ago
d30f8e8d
06f33489
-6
1 changed file
expand all
collapse all
unified
split
src
utils
scrollIntoViewIfNeeded.ts
-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
) {
0
0
7
if (!el) {
8
return;
9
}
···
29
let scrollContainer = getScrollParent(el);
30
let scrollContainerHeight = scrollContainer.clientHeight;
31
let distanceFromBottom = scrollContainerHeight - rect.bottom;
0
0
0
0
32
scrollContainer.scrollBy({
33
top: Math.abs(rootBottomMargin + distanceFromBottom),
34
behavior: behavior ? behavior : "auto",