From d7bb018c83a34364bdeb46691f462392aef0b356 Mon Sep 17 00:00:00 2001 From: Hiro Date: Sat, 28 Mar 2026 12:45:22 +0000 Subject: [PATCH] fix: prevent event propagation issues in sidebar and editor - Add type=button to Cancel/Save buttons in editor to prevent form submission - Add href=# and return false to quick-links to prevent default anchor behavior - StopPropagation was already present in sidebar handlers (verified) - Document view buttons already had type=button (verified) These fixes ensure: - Library/tag clicks don't bubble up and trigger wrong handlers - Quick-link buttons don't cause unexpected navigation - Editor buttons don't accidentally submit forms --- public/js/components/sidebar.js | 4 ++-- public/js/views/editor.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/public/js/components/sidebar.js b/public/js/components/sidebar.js index e7905f4..ea5cfbf 100644 --- a/public/js/components/sidebar.js +++ b/public/js/components/sidebar.js @@ -58,8 +58,8 @@ export function renderSidebar({ libraries, tags, selectedLibrary, selectedTag, o
📋 All Documents - 📄 New Document - 📁 New Library + 📄 New Document + 📁 New Library
diff --git a/public/js/views/editor.js b/public/js/views/editor.js index 442bb34..06e4baa 100644 --- a/public/js/views/editor.js +++ b/public/js/views/editor.js @@ -41,9 +41,9 @@ export async function renderEditor(app) { function render() { appEl.innerHTML = `
- + ${isNew ? 'New Document' : 'Editing: ' + escapeHtml(formData.title)} - +