Skip to content

Commit 6ba75e4

Browse files
authored
Merge pull request #1699 from waldo121/bug/1619
Block auxiliary clicks
2 parents 6d72095 + e799711 commit 6ba75e4

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

packages/app/app/App.js

+8-1
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,16 @@ class App extends React.PureComponent {
6767

6868
this.updateConnectivityStatus(navigator.onLine);
6969
window.addEventListener('online', () => this.updateConnectivityStatus(true));
70-
window.addEventListener('offline', () => this.updateConnectivityStatus(false));
70+
window.addEventListener('offline', () => this.updateConnectivityStatus(false));
71+
window.addEventListener('auxclick', this.blockMiddleClick);
7172
}
7273

74+
blockMiddleClick = (e) => {
75+
// https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/button
76+
if (e.button === 1) {
77+
e.preventDefault();
78+
}
79+
}
7380
updateConnectivityStatus = (isConnected) => {
7481
this.props.actions.changeConnectivity(isConnected);
7582
}

0 commit comments

Comments
 (0)