Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 3672cd38 authored by VIAUD Nathan's avatar VIAUD Nathan
Browse files

fix undo on text type input

parent 6ad2c88a
Branches
No related tags found
1 merge request!47Draft: Resolve "Adding undo/redo"
...@@ -97,5 +97,19 @@ export function getContentDefaultValues(type) { ...@@ -97,5 +97,19 @@ export function getContentDefaultValues(type) {
export function updateElementValue(elementId: string, nodeId: string, valueId: string, value: string): void { export function updateElementValue(elementId: string, nodeId: string, valueId: string, value: string): void {
const node = findNode(nodeId); const node = findNode(nodeId);
node.data.formValues[valueId] = value;
let id, formType, formValues;
if(nodeId === elementId) {
({id, formType, formValues} = node.data);
} else {
const element = node.data.elements.find(e => e.id === elementId);
({id, formType, formValues} = element);
}
if(editorStore.openedElementId !== id) {
const parentId = nodeId !== elementId ? nodeId : null;
editorStore.openFormPanel(id, formType, formValues, parentId);
}
formValues[valueId] = value;
} }
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment