Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
fix(launch_bar): some context menus intercepted by browser
Elian Doran8ec6125ec47f
diff --git a/apps/client/src/widgets/launch_bar/GenericButtons.tsx b/apps/client/src/widgets/launch_bar/GenericButtons.tsxindex ba29b303b5..6933233a66 100644--- a/apps/client/src/widgets/launch_bar/GenericButtons.tsx+++ b/apps/client/src/widgets/launch_bar/GenericButtons.tsx@@ -32,6 +32,9 @@ export function CustomNoteLauncher(props: {onClick={launch}onAuxClick={launch}onContextMenu={async evt => {+ // Must preventDefault synchronously — awaiting getTargetNoteId first would let the+ // native browser context menu open before showLauncherContextMenu gets a chance to.+ evt.preventDefault();const targetNoteId = await getTargetNoteId(launcherNote);const hoistedNoteId = getHoistedNoteId?.(launcherNote) ?? null;const linkItems = targetNoteId ? link_context_menu.getItems(evt) : [];diff --git a/apps/client/src/widgets/launch_bar/HistoryNavigation.tsx b/apps/client/src/widgets/launch_bar/HistoryNavigation.tsxindex 11ad476312..b35e38f337 100644--- a/apps/client/src/widgets/launch_bar/HistoryNavigation.tsx+++ b/apps/client/src/widgets/launch_bar/HistoryNavigation.tsx@@ -27,6 +27,8 @@ export default function HistoryNavigationButton({ launcherNote, command }: Histotext={title}triggerCommand={command}onContextMenu={async (e) => {+ // Prevent the native menu synchronously before awaiting history items.+ e.preventDefault();const items = webContents ? await getHistoryItems(webContents) : [];showLauncherContextMenu<string>(launcherNote, e, {extraItems: items,