From 57f169e365e69c52e4a9e56cf740f72d398951c2 Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Fri, 14 Mar 2025 03:53:21 +0100 Subject: [PATCH] inspector: prevent editing non-editable widgets (e.g matrix items) when clicking on their ids in error logs --- CHANGELOG.md | 1 + src/client/editor/context-menu.js | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 178bf142..af20c15f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ - ui: limit ctrl + scroll zoom speed - broken cli when `ELECTRON_RUN_AS_NODE` is set - inspector: input bug when a code editor was focused using the tab key + - inspector: prevent editing non-editable widgets (e.g matrix items) when clicking on their ids in error logs - widgets - fader: add `touchZone` property to allow restricting interaction to a part of the widget diff --git a/src/client/editor/context-menu.js b/src/client/editor/context-menu.js index 7b3d3aa8..6da2600c 100644 --- a/src/client/editor/context-menu.js +++ b/src/client/editor/context-menu.js @@ -30,6 +30,10 @@ var handleClick = function(event) { if (!targetWidget) return + while (targetWidget._not_editable && targetWidget.parent) { + targetWidget = targetWidget.parent + } + // if the widget is not already selected if (!targetWidget.container.classList.contains('editing') || event.detail.ctrlKey || event.detail.shiftKey) { // add a flag to the original event to prevent draginit