From 6ccf5c651d588b03ce151d7240067a0e82c783ed Mon Sep 17 00:00:00 2001 From: jos Date: Sat, 30 Mar 2019 14:13:25 +0100 Subject: [PATCH] Fix redo duplicate not checking for duplicate property names --- src/js/History.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/js/History.js b/src/js/History.js index 5bccbb2..6f70424 100644 --- a/src/js/History.js +++ b/src/js/History.js @@ -1,5 +1,7 @@ 'use strict'; +var util = require('./util'); + /** * @constructor History * Store action history, enables undo and redo @@ -121,6 +123,8 @@ function History (editor) { var nodes = params.paths.map(findNode); nodes.forEach(function (node) { var clone = node.clone(); + var existingFieldNames = parentNode.getFieldNames(); + clone.field = util.findUniqueName(node.field, existingFieldNames); parentNode.insertAfter(clone, afterNode); afterNode = clone; });