From 68397edd4d57af9203f701442afd514bb8aea9fd Mon Sep 17 00:00:00 2001 From: AzazelN28 Date: Mon, 18 Nov 2024 12:41:07 +0100 Subject: [PATCH] :bug: Fix text editor selection --- frontend/src/app/main/data/workspace/text/shortcuts.cljs | 4 ++-- frontend/src/app/main/ui/workspace/viewport.cljs | 1 + frontend/src/app/util/text/ui.cljs | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/frontend/src/app/main/data/workspace/text/shortcuts.cljs b/frontend/src/app/main/data/workspace/text/shortcuts.cljs index 6ef891057..4521bc4f4 100644 --- a/frontend/src/app/main/data/workspace/text/shortcuts.cljs +++ b/frontend/src/app/main/data/workspace/text/shortcuts.cljs @@ -115,8 +115,8 @@ (defn calculate-text-values [shape] (let [state-map (if (features/active-feature? @st/state "text-editor/v2") - (deref refs/workspace-v2-editor-state) - (deref refs/workspace-editor-state)) + (deref refs/workspace-v2-editor-state) + (deref refs/workspace-editor-state)) editor-state (get state-map (:id shape)) editor-instance (when (features/active-feature? @st/state "text-editor/v2") (deref refs/workspace-editor))] diff --git a/frontend/src/app/main/ui/workspace/viewport.cljs b/frontend/src/app/main/ui/workspace/viewport.cljs index 09c721bf2..a89eab0c6 100644 --- a/frontend/src/app/main/ui/workspace/viewport.cljs +++ b/frontend/src/app/main/ui/workspace/viewport.cljs @@ -171,6 +171,7 @@ (and (some? drawing-obj) (= :path (:type drawing-obj)))) node-editing? (and edition (= :path (get-in base-objects [edition :type]))) text-editing? (and edition (= :text (get-in base-objects [edition :type]))) + grid-editing? (and edition (ctl/grid-layout? base-objects edition)) mode-inspect? (= options-mode :inspect) diff --git a/frontend/src/app/util/text/ui.cljs b/frontend/src/app/util/text/ui.cljs index 71bb704ee..106e1b05a 100644 --- a/frontend/src/app/util/text/ui.cljs +++ b/frontend/src/app/util/text/ui.cljs @@ -16,7 +16,7 @@ (defn v2-closest-text-editor-content [target] - (.closest ^js target ".text-editor-content")) + (.closest ^js target "[data-itype=\"editor\"]")) (defn closest-text-editor-content [target] @@ -34,7 +34,7 @@ (defn v2-get-text-editor-content [] - (dom/get-element-by-class "text-editor-content")) + (dom/query "[data-itype=\"editor\"]")) (defn get-text-editor-content []