From 498c1241cd6448636d4adaccf43532b0db6da1ea Mon Sep 17 00:00:00 2001 From: Brian Clifton Date: Thu, 8 Jun 2017 23:41:45 -0700 Subject: [PATCH] Don't activate tab on right click Fixes https://github.com/brave/browser-laptop/issues/7327 Auditors: @NejcZdovc, @cezaraugusto --- app/renderer/components/tabs/tab.js | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/app/renderer/components/tabs/tab.js b/app/renderer/components/tabs/tab.js index d1049649107..bb8616f03f7 100644 --- a/app/renderer/components/tabs/tab.js +++ b/app/renderer/components/tabs/tab.js @@ -170,11 +170,17 @@ class Tab extends React.Component { } onClickTab (e) { - if (e.button === 1) { - this.onTabClosedWithMouse(e) - } else { - e.stopPropagation() - appActions.tabActivateRequested(this.props.tabId) + switch (e.button) { + case 2: + // Ignore right click + return + case 1: + // Close tab with middle click + this.onTabClosedWithMouse(e) + break + default: + e.stopPropagation() + appActions.tabActivateRequested(this.props.tabId) } }