tangled
alpha
login
or
join now
leaflet.pub
/
leaflet
291
fork
atom
a tool for shared writing and social publishing
291
fork
atom
overview
issues
27
pulls
pipelines
tweak scrollinto view behavior
awarm.space
6 months ago
b4dccb84
e5f6b85c
+7
-4
1 changed file
expand all
collapse all
unified
split
app
lish
[did]
[publication]
[rkey]
Interactions
Interactions.tsx
+7
-4
app/lish/[did]/[publication]/[rkey]/Interactions/Interactions.tsx
···
87
87
let isOffscreen = false;
88
88
if (el) {
89
89
const rect = el.getBoundingClientRect();
90
90
-
const windowHeight =
91
91
-
window.innerHeight || document.documentElement.clientHeight;
92
90
const windowWidth =
93
91
window.innerWidth || document.documentElement.clientWidth;
94
94
-
isOffscreen = rect.right > windowWidth;
92
92
+
isOffscreen = rect.right > windowWidth - 64;
95
93
}
96
94
97
97
-
if (el && isOffscreen) el.scrollIntoView({ behavior: "smooth" });
95
95
+
if (el && isOffscreen)
96
96
+
el.scrollIntoView({
97
97
+
behavior: "smooth",
98
98
+
block: "center",
99
99
+
inline: "center",
100
100
+
});
98
101
}
99
102
100
103
export const Interactions = (props: {