Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,7 @@
window.addEventListener('resize', handleWindowResize, { passive: true });
}

document.addEventListener('click', handleClickOutside, { passive: true });
document.addEventListener('mousedown', handleClickOutside, { passive: true });
});

onUnmounted(() => {
Expand All @@ -544,7 +544,7 @@
} else {
window.removeEventListener('resize', handleWindowResize);
}
document.removeEventListener('click', handleClickOutside);
document.removeEventListener('mousedown', handleClickOutside);
});

return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,15 +93,15 @@ export function useDropdowns() {
};

onMounted(() => {
document.addEventListener('click', handleClickOutside);
document.addEventListener('mousedown', handleClickOutside);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

praise: The root cause analysis here is excellent — tracing the missing click events to two independent preventDefault() paths (ProseMirror's mouseup and ToolbarButton's @mousedown.prevent) and choosing mousedown as the fix point is well-reasoned. The change is minimal and precise.

// Setup editor listener when component mounts
setupEditorListener();
// Initial format detection
updateSelectedFormat();
});

onUnmounted(() => {
document.removeEventListener('click', handleClickOutside);
document.removeEventListener('mousedown', handleClickOutside);
if (offTransaction) offTransaction();
});

Expand Down
Loading