Skip to content

Open source website builder and Webflow alternative. Webstudio is an advanced visual builder that connects to any headless CMS, supports all CSS properties, and can be hosted anywhere, including with us.

fix: allow native context menu when editing content (#5626)

Oleg Isonencb92f50ae65a
diff --git a/apps/builder/app/canvas/instance-context-menu.ts b/apps/builder/app/canvas/instance-context-menu.ts
index a7707ec47d..d6e0991875 100644
--- a/apps/builder/app/canvas/instance-context-menu.ts
+++ b/apps/builder/app/canvas/instance-context-menu.ts
@@ -1,8 +1,16 @@
import { selectorIdAttribute } from "@webstudio-is/react-sdk";
-import { $instanceContextMenu } from "~/shared/nano-states";
+import {
+ $instanceContextMenu,
+ $textEditingInstanceSelector,
+} from "~/shared/nano-states";
export const subscribeInstanceContextMenu = () => {
const handleContextMenu = (event: MouseEvent) => {
+ // Allow native context menu when editing text content
+ if ($textEditingInstanceSelector.get() !== undefined) {
+ return;
+ }
+
const target = event.target as HTMLElement;
const element = target.closest(`[${selectorIdAttribute}]`);
const selectorId = element?.getAttribute(selectorIdAttribute);