mirror of
https://github.com/bretzel-app/crumbs.git
synced 2026-10-12 20:06:57 +02:00
fix: close mobile sidebar on navigation
Sidebar filter and tag selection handlers now call onClose() on mobile viewports (< 1024px), so the overlay dismisses after tapping a link. Closes #10 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
3629e48532
commit
7f42bc616d
@@ -11,14 +11,22 @@
|
||||
|
||||
let { open, onClose, appVersion }: Props = $props();
|
||||
|
||||
function closeMobile() {
|
||||
if (window.matchMedia('(max-width: 1023px)').matches) {
|
||||
onClose?.();
|
||||
}
|
||||
}
|
||||
|
||||
function setFilter(filter: NoteFilter) {
|
||||
selectedTag.set(null);
|
||||
loadNotes(filter);
|
||||
closeMobile();
|
||||
}
|
||||
|
||||
function selectTag(tag: string | null) {
|
||||
selectedTag.set(tag);
|
||||
loadNotes('all');
|
||||
closeMobile();
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user