From e9d18766997680900eb9fbfe755ea2b1d37dcb13 Mon Sep 17 00:00:00 2001 From: "Rajaa.BARHTAOUI" Date: Tue, 15 Jan 2019 10:35:31 +0100 Subject: [PATCH] fix(xo-web/link): middle click opens two tabs in firefox (#3825) Fixes #3450 --- CHANGELOG.md | 1 + packages/xo-web/src/common/link.js | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5ff715f6a..8a5ad60ab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ ### Bug fixes - [New SR] No redirection if the SR creation failed or canceled [#3843](https://github.com/vatesfr/xen-orchestra/issues/3843) (PR [#3853](https://github.com/vatesfr/xen-orchestra/pull/3853)) +- [Home] Fix two tabs opened by middle click in Firefox [#3450](https://github.com/vatesfr/xen-orchestra/issues/3450) (PR [#3825](https://github.com/vatesfr/xen-orchestra/pull/3825)) ### Released packages diff --git a/packages/xo-web/src/common/link.js b/packages/xo-web/src/common/link.js index 7c3e2bd5a..cd5d8056d 100644 --- a/packages/xo-web/src/common/link.js +++ b/packages/xo-web/src/common/link.js @@ -50,7 +50,8 @@ export class BlockLink extends Component { // FIXME: when https://github.com/facebook/react/issues/8529 is fixed, // remove and use onAuxClickCapture. // In Chrome ^55, middle-clicking triggers auxclick event instead of click - if (ref !== null) { + // Other browsers may trigger both events. + if (!!window.chrome && ref !== null) { ref.addEventListener('auxclick', this._onClickCapture) } }