Merge pull request #8364 from 01zulfi/editor/fix-readonly-links

editor: fix internal links opening in new tab in readonly notes
This commit is contained in:
Abdullah Atta
2025-07-16 11:50:58 +05:00
committed by GitHub

View File

@@ -30,7 +30,8 @@ export function clickHandler(options: ClickHandlerOptions): Plugin {
return new Plugin({ return new Plugin({
key: new PluginKey("handleClickLink"), key: new PluginKey("handleClickLink"),
props: { props: {
handleClick: (view, pos, event) => { handleDOMEvents: {
click: (view, event) => {
const isMainClick = event.button === 0; const isMainClick = event.button === 0;
const isAuxClick = event.button === 1; const isAuxClick = event.button === 1;
if (!isMainClick && !isAuxClick) { if (!isMainClick && !isAuxClick) {
@@ -72,5 +73,6 @@ export function clickHandler(options: ClickHandlerOptions): Plugin {
return false; return false;
} }
} }
}
}); });
} }