From 7800fac7cf87bd2be6c937688861ebc9a690c797 Mon Sep 17 00:00:00 2001 From: Pierre-Charles David Date: Mon, 12 Dec 2022 15:31:35 +0100 Subject: [PATCH] [1346] Avoid unnecessary invocations of the editRichText mutation Bug: https://github.com/eclipse-sirius/sirius-components/issues/1346 Signed-off-by: Pierre-Charles David --- .../src/propertysections/RichTextPropertySection.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/forms/frontend/sirius-components-forms/src/propertysections/RichTextPropertySection.tsx b/packages/forms/frontend/sirius-components-forms/src/propertysections/RichTextPropertySection.tsx index 05cf839e8f..95f55da4d0 100644 --- a/packages/forms/frontend/sirius-components-forms/src/propertysections/RichTextPropertySection.tsx +++ b/packages/forms/frontend/sirius-components-forms/src/propertysections/RichTextPropertySection.tsx @@ -158,7 +158,9 @@ export const RichTextPropertySection = ({ const onFocus = () => sendUpdateWidgetFocus(true); const onBlur = (currentText: string) => { sendUpdateWidgetFocus(false); - sendEditedValue(currentText); + if (currentText !== widget.stringValue) { + sendEditedValue(currentText); + } }; return (