fix(frontend): fix toast positioning with wrapper div and inline styles
This commit is contained in:
@@ -11,7 +11,10 @@ pub fn App() -> impl IntoView {
|
||||
crate::store::provide_torrent_store();
|
||||
|
||||
view! {
|
||||
<div class="drawer lg:drawer-open h-screen w-full" style="height: 100dvh;">
|
||||
// Main app wrapper - ensures proper stacking context
|
||||
<div class="relative w-full h-screen" style="height: 100dvh;">
|
||||
// Drawer layout
|
||||
<div class="drawer lg:drawer-open h-full w-full">
|
||||
<input id="my-drawer" type="checkbox" class="drawer-toggle" />
|
||||
|
||||
<div class="drawer-content flex flex-col h-full overflow-hidden bg-base-100 text-base-content text-sm select-none">
|
||||
@@ -39,7 +42,8 @@ pub fn App() -> impl IntoView {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
// Toast container - outside drawer for correct fixed positioning
|
||||
// Toast container - fixed positioning relative to viewport
|
||||
<ToastContainer />
|
||||
</div>
|
||||
}
|
||||
}
|
||||
|
||||
@@ -71,16 +71,22 @@ pub fn ToastContainer() -> impl IntoView {
|
||||
let notifications = store.notifications;
|
||||
|
||||
view! {
|
||||
<div class="fixed bottom-4 right-4 z-[9999] flex flex-col gap-2 items-end">
|
||||
// Fixed to viewport with explicit inset values for reliable positioning
|
||||
<div
|
||||
class="fixed flex flex-col gap-2 items-end pointer-events-none"
|
||||
style="bottom: 16px; right: 16px; z-index: 99999;"
|
||||
>
|
||||
<For
|
||||
each=move || notifications.get()
|
||||
key=|item| item.id
|
||||
children=move |item| {
|
||||
view! {
|
||||
<div class="pointer-events-auto">
|
||||
<ToastItem
|
||||
level=item.notification.level
|
||||
message=item.notification.message
|
||||
/>
|
||||
</div>
|
||||
}
|
||||
}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user