You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Web: onLinkPress swallows cmd/ctrl/shift-click, so links can't open in a new tab #1084
When onLinkPress is set, LinkRenderer calls event.preventDefault() and onLinkPress for every click. The docs recommend onLinkPress for in-app navigation, since target isn't configurable on web, but then cmd/ctrl-click (open in new tab) and shift-click (new window) stop working. Users lose standard browser behaviour on what are real <a href> links. (Middle-click is unaffected, since it fires auxclick, not click.)
Suggested fix: follow the convention web routers use (React Navigation's useLinkProps, React Router's and Next.js's Link): handle only plain primary clicks, and leave modified clicks to the browser. Links the browser can't open, such as custom-scheme mentions (user://…), keep going to onLinkPress:
constBROWSER_SCHEME=/^(https?:|mailto:|\/|#|\?)/i;consthandleClick=(event: MouseEvent)=>{constisModified=event.metaKey||event.ctrlKey||event.shiftKey||event.altKey||event.button!==0;if(isModified&&BROWSER_SCHEME.test(url)){return;// the browser opens it as it would any link}if(callbacks.onLinkPress){event.preventDefault();callbacks.onLinkPress({ url });}};
This needs no new API. Plain clicks behave exactly as today.
Hi @ericpoulinnz, thanks for the report! Leaving modified clicks to the browser sounds right, and it should be an easy fix. This should be fixed before the next minor release.
Activity
eszlamczyk commentedon Oct 26, 2026
Hi @ericpoulinnz, thanks for the report! Leaving modified clicks to the browser sounds right, and it should be an easy fix. This should be fixed before the next minor release.