diff --git a/src/status-bar/StatusBar.test.tsx b/src/status-bar/StatusBar.test.tsx
index 1c0de312..b96a5ce9 100644
--- a/src/status-bar/StatusBar.test.tsx
+++ b/src/status-bar/StatusBar.test.tsx
@@ -1,21 +1,13 @@
// SPDX-License-Identifier: MIT
// Copyright (c) 2021-2022 The Pybricks Authors
-import { fireEvent, waitFor } from '@testing-library/react';
+import { waitFor } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import React from 'react';
import { testRender } from '../../test';
import { BleConnectionState } from '../ble/reducers';
import StatusBar from './StatusBar';
-it('should prevent browser context menu', () => {
- const [statusBar] = testRender(
, {
- ble: { connection: BleConnectionState.Disconnected, deviceName: '' },
- });
-
- expect(fireEvent.contextMenu(statusBar.getByRole('status'))).toBe(false);
-});
-
it('should show popover when hub name is clicked', async () => {
const testHubName = 'Test hub';
diff --git a/src/status-bar/StatusBar.tsx b/src/status-bar/StatusBar.tsx
index 2729ec80..2a6dc878 100644
--- a/src/status-bar/StatusBar.tsx
+++ b/src/status-bar/StatusBar.tsx
@@ -7,7 +7,6 @@ import { I18n, useI18n } from '@shopify/react-i18n';
import React from 'react';
import { BleConnectionState } from '../ble/reducers';
import { useSelector } from '../reducers';
-import { preventBrowserNativeContextMenu } from '../utils/react';
import { I18nId } from './i18n';
import './status-bar.scss';
@@ -113,12 +112,7 @@ const StatusBar: React.VFC = (_props) => {
const connection = useSelector((s) => s.ble.connection);
return (
-
+
{connection === BleConnectionState.Connected && (
<>
diff --git a/src/toolbar/Toolbar.tsx b/src/toolbar/Toolbar.tsx
index 313453ed..62142692 100644
--- a/src/toolbar/Toolbar.tsx
+++ b/src/toolbar/Toolbar.tsx
@@ -3,7 +3,6 @@
import { ButtonGroup } from '@blueprintjs/core';
import React from 'react';
-import { preventBrowserNativeContextMenu } from '../utils/react';
import BluetoothButton from './buttons/bluetooth/BluetoothButton';
import FlashButton from './buttons/flash/FlashButton';
import ReplButton from './buttons/repl/ReplButton';
@@ -14,11 +13,7 @@ import './toolbar.scss';
const Toolbar: React.VFC = (_props) => {
return (
-
+
diff --git a/src/utils/react.ts b/src/utils/react.ts
index ce50b285..ca54ef00 100644
--- a/src/utils/react.ts
+++ b/src/utils/react.ts
@@ -3,13 +3,6 @@
import React, { useState } from 'react';
import { createCountFunc } from './iter';
-/**
- * Callback that can be passed to onContextMenu event handlers to prevent
- * the native browser context menu from being shown.
- */
-export const preventBrowserNativeContextMenu: React.MouseEventHandler = (e) =>
- e.preventDefault();
-
/** Style to disable pointer events. */
export const pointerEventsNone: React.CSSProperties = { pointerEvents: 'none' };