From 0e64a0e1c5edca76cfbd284e22c5a1d0eb6cf7b8 Mon Sep 17 00:00:00 2001 From: Imiss-U1025 Date: Thu, 6 Feb 2025 01:13:11 -0500 Subject: [PATCH] Make the variable name unique among editorState --- .../lowcoder/src/comps/comps/simpleVariableHeaderComp.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/client/packages/lowcoder/src/comps/comps/simpleVariableHeaderComp.tsx b/client/packages/lowcoder/src/comps/comps/simpleVariableHeaderComp.tsx index a709da485..800ecc148 100644 --- a/client/packages/lowcoder/src/comps/comps/simpleVariableHeaderComp.tsx +++ b/client/packages/lowcoder/src/comps/comps/simpleVariableHeaderComp.tsx @@ -1,12 +1,13 @@ import { ControlParams } from "comps/controls/controlParams"; +import { EditorContext } from "comps/editorState"; import { CompAction, SimpleComp } from "lowcoder-core"; import { ControlPropertyViewWrapper, PopupCard, Input } from "lowcoder-design"; -import { useEffect, useState } from "react"; +import { useContext, useEffect, useState } from "react"; import { trans } from "i18n"; -import { checkName } from "../utils/rename"; const SimpleVariableHeaderPropertyView = ({params, comp, isCheck}: any) => { const [error, setError] = useState(); const [value, setValue] = useState(comp.value); + const editorState = useContext(EditorContext); useEffect(() => { setValue(comp.value); isCheck && setError(undefined); @@ -17,7 +18,7 @@ const SimpleVariableHeaderPropertyView = ({params, comp, isCheck}: any) => { value={value} placeholder={params.placeholder} onChange={(e) => { - const error = isCheck && checkName(e.target.value); + const error = isCheck && editorState.checkRename(value, e.target.value); isCheck && setError(error || undefined); setValue(e.target.value); }} pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy