kommitters / editorjs-undo

Undo/Redo feature for Editor.js
https://www.npmjs.com/package/editorjs-undo
MIT License
163 stars 50 forks source link

Solve bug in redo when try to split and enter a new paragraph. #244

Closed MarioRodriguezS closed 3 months ago

MarioRodriguezS commented 3 months ago

Description

There was a bug when the user tried to split a paragraph, enter to create a new paragraph, undo the action, and redo it. The paragraph content was being duplicated:

https://github.com/kommitters/editorjs-undo/assets/64106728/9b150a5f-c61e-4dba-8a49-5ba1a23cddb6

Solution

To solve the issue, a corner case was complemented to consider this use case:

https://github.com/kommitters/editorjs-undo/assets/64106728/30e4b9dd-2e8b-4d2e-b2f7-a02bfc4fc5a0