diff icon indicating copy to clipboard operation
diff copied to clipboard

Incorrectly formed deleted array element

Open gluhovalexey opened this issue 4 years ago • 3 comments

These are two arrays, they differ in the middle element var o1 = {files: [{pages: [{id: 1, name: 'abc'},{id: 2, name: 'def'},{id: 3, name: 'jhk'}]} ]} var o2 = {files: [{pages: [{id: 1, name: 'abc'},{id: 3, name: 'jhk'}]} ]}

diff Shows the following result:

DiffArray index: 2 item: DiffDeleted {kind: "D", lhs: Object {id: 3, name: "jhk"}} kind: "A" path: ["files", 0, "pages"]"

That is, always the last element

gluhovalexey avatar Jun 02 '20 14:06 gluhovalexey

I have encountered the same issue, any changes in array returns the last element as changed.

As a workaround, if the diff array is larger than 1, I'm concatenating the index of the last "edited" element.

Created a stackblitz as example

ndraiman avatar Jun 17 '20 10:06 ndraiman

any progress?

Miller547719886 avatar Sep 12 '21 11:09 Miller547719886

any progress?

serdarsrts avatar Jun 07 '23 16:06 serdarsrts