diff --git a/frontend/src/AppBuilder/_stores/slices/componentsSlice.js b/frontend/src/AppBuilder/_stores/slices/componentsSlice.js index f7c64475c6..7fb9650075 100644 --- a/frontend/src/AppBuilder/_stores/slices/componentsSlice.js +++ b/frontend/src/AppBuilder/_stores/slices/componentsSlice.js @@ -1192,8 +1192,16 @@ export const createComponentsSlice = (set, get) => ({ 'setComponentProperty' ); + const oldComponent = get().modules[moduleId].pages[currentPageIndex].components[componentId].component; + const { events, exposedVariables, ...filteredDefinition } = oldComponent.definition || {}; + const diff = { - [componentId]: { component: get().modules[moduleId].pages[currentPageIndex].components[componentId].component }, + [componentId]: { + component: { + ...oldComponent, + definition: filteredDefinition, + }, + }, }; if (saveAfterAction) { @@ -1236,8 +1244,16 @@ export const createComponentsSlice = (set, get) => ({ ); } + const oldComponent = get().modules[moduleId].pages[currentPageIndex].components[componentId].component; + const { events, exposedVariables, ...filteredDefinition } = oldComponent.definition || {}; + const diff = { - [componentId]: { component: get().modules[moduleId].pages[currentPageIndex].components[componentId].component }, + [componentId]: { + component: { + ...oldComponent, + definition: filteredDefinition, + }, + }, }; if (saveAfterAction) {