Double make sure header change doesn't block scrolling

This commit is contained in:
Lim Chee Aun 2024-01-04 19:09:30 +08:00
parent 6919975c6d
commit a8331375ba
2 changed files with 15 additions and 2 deletions

View file

@ -7,6 +7,7 @@
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
align-self: stretch;
}
.status-deck header h1 .deck-back {
margin-left: -16px;

View file

@ -735,7 +735,13 @@ function StatusThread({ id, closeLink = '/', instance: propInstance }) {
<>
<InView
threshold={0.1}
onChange={setHeroInView}
onChange={(inView) => {
queueMicrotask(() => {
requestAnimationFrame(() => {
setHeroInView(inView);
});
});
}}
class="status-focus"
tabIndex={0}
>
@ -813,7 +819,13 @@ function StatusThread({ id, closeLink = '/', instance: propInstance }) {
<InView
skip={i !== 0 || !ancestor}
threshold={0.5}
onChange={setReachTopPost}
onChange={(inView) => {
queueMicrotask(() => {
requestAnimationFrame(() => {
setReachTopPost(inView);
});
});
}}
>
<Status
statusID={statusID}