fix(xo-web/link): middle click opens two tabs in firefox (#3825)

Fixes #3450
This commit is contained in:
Rajaa.BARHTAOUI 2019-01-15 10:35:31 +01:00 committed by Pierre Donias
parent f25705d559
commit e9d1876699
2 changed files with 3 additions and 1 deletions

View File

@ -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

View File

@ -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)
}
}