This is an automated email from the ASF dual-hosted git repository.
thiagoelg pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-kie-tools.git
The following commit(s) were added to refs/heads/main by this push:
new ed8135f5369 kie-issues#2172: DMN Editor: Editing Data Type enum
constraints moves characters to the last position (#3354)
ed8135f5369 is described below
commit ed8135f5369a92112ebc359c7a74f52ef05c4f09
Author: Aswathi <[email protected]>
AuthorDate: Fri Nov 21 20:12:54 2025 +0530
kie-issues#2172: DMN Editor: Editing Data Type enum constraints moves
characters to the last position (#3354)
---
packages/dmn-editor/src/dataTypes/ConstraintsEnum.tsx | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/packages/dmn-editor/src/dataTypes/ConstraintsEnum.tsx
b/packages/dmn-editor/src/dataTypes/ConstraintsEnum.tsx
index 1c4c31cc354..1161b16558b 100644
--- a/packages/dmn-editor/src/dataTypes/ConstraintsEnum.tsx
+++ b/packages/dmn-editor/src/dataTypes/ConstraintsEnum.tsx
@@ -216,15 +216,22 @@ function EnumElement({
onKeyDown: (e: React.KeyboardEvent<HTMLElement>) => void;
}) {
const { i18n } = useDmnEditorI18n();
- const value = useMemo<string>(() => initialValue, [initialValue]);
+ const [value, setValue] = useState<string>(initialValue);
const removeButtonRef = useRef(null);
const { hovered } = useDraggableItemContext();
+ React.useEffect(() => {
+ setValue(initialValue);
+ }, [initialValue]);
+
return (
<div style={{ display: "flex", flexDirection: "row", justifyContent:
"space-between" }}>
{typeHelper.component({
autoFocus: true,
- onChange: (newValue: string) => onChange(newValue),
+ onChange: (newValue: string) => {
+ setValue(newValue);
+ onChange(newValue);
+ },
id,
isDisabled,
style: {
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]