mirror of
https://github.com/openswarm-ai/openswarm.git
synced 2026-08-30 11:49:50 +02:00
[eric] canvas: suppress native context menu on right-drag marquee (not on cards/inputs)
This commit is contained in:
@@ -310,6 +310,15 @@ const DashboardCanvas: React.FC<DashboardCanvasProps> = ({
|
||||
onMouseMove={onViewportMouseMove}
|
||||
onMouseUp={onViewportMouseUp}
|
||||
onDoubleClick={onViewportDoubleClick}
|
||||
onContextMenu={(e) => {
|
||||
// Right-drag is the canvas marquee-select (Google-Maps style), so the native menu (Inspect
|
||||
// Element in dev) shouldn't pop over it. Suppress only on the bare canvas; cards, inputs, and
|
||||
// webviews keep their own menus.
|
||||
const t = e.target as HTMLElement;
|
||||
if (!t.closest('[data-select-id]') && !t.closest('input, textarea, [contenteditable]')) {
|
||||
e.preventDefault();
|
||||
}
|
||||
}}
|
||||
sx={{
|
||||
position: 'absolute',
|
||||
inset: 0,
|
||||
|
||||
Reference in New Issue
Block a user