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
This commit is contained in:
Hiro
2026-03-28 12:45:22 +00:00
parent 929c658e45
commit d7bb018c83
2 changed files with 4 additions and 4 deletions

View File

@@ -58,8 +58,8 @@ export function renderSidebar({ libraries, tags, selectedLibrary, selectedTag, o
</div>
<div class="quick-links">
<a class="quick-link" data-action="home">📋 All Documents</a>
<a class="quick-link" onclick="window.showNewDocModal()">📄 New Document</a>
<a class="quick-link" onclick="window.showNewLibraryModal()">📁 New Library</a>
<a class="quick-link" href="#" onclick="window.showNewDocModal(); return false;">📄 New Document</a>
<a class="quick-link" href="#" onclick="window.showNewLibraryModal(); return false;">📁 New Library</a>
</div>
</div>
</aside>