Skip to content

Commit 88c47c2

Browse files
authored
fix(dev-overlay): Ignore right clicks on the indicator draggable (#79120)
Without this change, right clicking on the indicator starts the drag action, which leads to janky behavior with the native browser context menu. Only allow dragging with the primary mouse button. I also tested this in the mobile simulator mode to make sure I didn't break anything there.
1 parent 6258af6 commit 88c47c2

File tree

1 file changed

+3
-0
lines changed
  • packages/next/src/client/components/react-dev-overlay/ui/components/errors/dev-tools-indicator

1 file changed

+3
-0
lines changed

packages/next/src/client/components/react-dev-overlay/ui/components/errors/dev-tools-indicator/draggable.tsx

+3
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,9 @@ export function useDrag(options: UseDragOptions) {
186186
}
187187

188188
function onPointerDown(e: React.PointerEvent) {
189+
if (e.button !== 0) {
190+
return // ignore right click
191+
}
189192
origin.current = { x: e.clientX, y: e.clientY }
190193
state.current = 'press'
191194
window.addEventListener('pointermove', onPointerMove)

0 commit comments

Comments
 (0)