mirror of
https://github.com/outline/outline.git
synced 2026-06-13 11:25:03 +03:00
Fix middle mouse button link behavior (#9632)
- Add check for middle mouse button (event.button === 1) in link click handler - Middle mouse button clicks now properly open links in new tabs instead of current tab - Fixes issue where MMB acted like LMB and caused duplicate tab opening - Issue was present since version 0.83.0 and reported in 0.85.1 Co-authored-by: codegen-sh[bot] <131295404+codegen-sh[bot]@users.noreply.github.com>
This commit is contained in:
@@ -64,7 +64,10 @@ export default function useEditorClickHandlers({ shareId }: Params) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!event || (!isModKey(event) && !event.shiftKey)) {
|
||||
if (
|
||||
!event ||
|
||||
(!isModKey(event) && !event.shiftKey && event.button !== 1)
|
||||
) {
|
||||
history.push(navigateTo, { sidebarContext: "collections" }); // optimistic preference of "collections"
|
||||
} else {
|
||||
window.open(navigateTo, "_blank");
|
||||
|
||||
Reference in New Issue
Block a user