TootBottomSheet: test scrollable

This commit is contained in:
thislight 2024-11-10 21:39:10 +08:00
parent 34dd95e959
commit 8066f699bd
No known key found for this signature in database
GPG key ID: FCFE5192241CCD4E
2 changed files with 74 additions and 57 deletions

View file

@ -0,0 +1,18 @@
.TootBottomSheet {
overflow: hidden;
.Scrollable {
padding-bottom: var(--safe-area-inset-bottom, 0);
overflow-y: auto;
overscroll-behavior-y: contain;
max-height: calc(100vh - var(--scaffold-topbar-height, 0px));
max-height: calc(100dvh - var(--scaffold-topbar-height, 0px));
}
.progress-line {
display: flex;
justify-content: center;
margin-top: 12px;
margin-bottom: 12px;
}
}

View file

@ -11,9 +11,7 @@ import {
import Scaffold from "../material/Scaffold"; import Scaffold from "../material/Scaffold";
import { AppBar, CircularProgress, IconButton, Toolbar } from "@suid/material"; import { AppBar, CircularProgress, IconButton, Toolbar } from "@suid/material";
import { Title } from "../material/typography"; import { Title } from "../material/typography";
import { import { Close as CloseIcon } from "@suid/icons-material";
Close as CloseIcon,
} from "@suid/icons-material";
import { useSessionForAcctStr } from "../masto/clients"; import { useSessionForAcctStr } from "../masto/clients";
import { resolveCustomEmoji } from "../masto/toot"; import { resolveCustomEmoji } from "../masto/toot";
import RegularToot, { findElementActionable } from "./RegularToot"; import RegularToot, { findElementActionable } from "./RegularToot";
@ -26,6 +24,7 @@ import TootComposer from "./TootComposer";
import { useDocumentTitle } from "../utils"; import { useDocumentTitle } from "../utils";
import { createTimelineControlsForArray } from "../masto/timelines"; import { createTimelineControlsForArray } from "../masto/timelines";
import TootList from "./TootList"; import TootList from "./TootList";
import "./TootBottomSheet.css";
let cachedEntry: [string, mastodon.v1.Status] | undefined; let cachedEntry: [string, mastodon.v1.Status] | undefined;
@ -245,6 +244,10 @@ const TootBottomSheet: Component = (props) => {
</Toolbar> </Toolbar>
</AppBar> </AppBar>
} }
class="TootBottomSheet"
>
<div
class="Scrollable"
> >
<TimeSourceProvider value={time}> <TimeSourceProvider value={time}>
<TootList <TootList
@ -286,11 +289,7 @@ const TootBottomSheet: Component = (props) => {
<Show when={tootContextErrorUncaught.loading}> <Show when={tootContextErrorUncaught.loading}>
<div <div
style={{ class="progress-line"
display: "flex",
"justify-content": "center",
"margin-block": "12px",
}}
> >
<CircularProgress style="width: 1.5em; height: 1.5em;" /> <CircularProgress style="width: 1.5em; height: 1.5em;" />
</div> </div>
@ -302,7 +301,7 @@ const TootBottomSheet: Component = (props) => {
onChangeToot={descendants.set} onChangeToot={descendants.set}
/> />
</TimeSourceProvider> </TimeSourceProvider>
<div style={{ height: "var(--safe-area-inset-bottom, 0)" }}></div> </div>
</Scaffold> </Scaffold>
); );
}; };