mirror of
https://github.com/appwrite/console.git
synced 2026-11-18 20:47:21 +00:00
auto-dismiss SideSheet on navigation to prevent lingering Duplicate/Update row sheets
This commit is contained in:
1 parent
8e92c78881
commit
7331e0c09b
1 file changed
+6
+6
@@ -6,11 +6,13 @@
|
||||
import { isTabletViewport } from '$lib/stores/viewport';
|
||||
import { Badge, Divider, Layout, Sheet, Tag, Typography } from '@appwrite.io/pink-svelte';
|
||||
import type { HTMLAttributes } from 'svelte/elements';
|
||||
import { beforeNavigate } from '$app/navigation';
|
||||
|
||||
let {
|
||||
show = $bindable(false),
|
||||
title,
|
||||
closeOnBlur = false,
|
||||
autoCloseOnNavigate = true,
|
||||
submit,
|
||||
cancel,
|
||||
children = null,
|
||||
@@ -23,6 +25,7 @@
|
||||
title: string;
|
||||
titleBadge?: string;
|
||||
closeOnBlur?: boolean;
|
||||
autoCloseOnNavigate?: boolean;
|
||||
topAction?:
|
||||
| {
|
||||
text: string;
|
||||
@@ -54,6 +57,9 @@
|
||||
let submitting = $state(writable(false));
|
||||
|
||||
let copyText = $state(undefined);
|
||||
beforeNavigate(() => {
|
||||
if (autoCloseOnNavigate) show = false;
|
||||
});
|
||||
</script>
|
||||
|
||||
<div class="sheet-container" data-side-sheet-visible={show} {...restProps}>
|
||||
|
||||
Reference in new issue
Block a user