Skip to content

Can't undo first edit in editor based on div tag #71

Description

@davidyuk

If editor text prop contains empty string, and I want to type "Lorem" and then undo it by ctrl+z, first argument of onChange callback will be called with values:

"L"
"<p>L</p>"
"<p>Lo</p>"
"<p>Lor</p>"
"<p>Lore</p>"
"<p>Lorem</p>"
"<p>Lore</p>"
"<p>Lor</p>"
"<p>Lo</p>"
"<p>L</p>"
"L"
"<p>L</p>"
"L"
"<p>L</p>"
"L"
"<p>L</p>"
...

So, I can't undo typing of first letter "L".
Editor example with empty initial text value: https://davidyuk.github.io/react-medium-editor/

Also, if I use <p></p> as initial value, I can undo all, but content places before <p>:

"L<p></p>"
"Lo<p></p>"
"Lor<p></p>"
"Lore<p></p>"
"Lorem<p></p>"
"Lore<p></p>"
"Lor<p></p>"
"Lo<p></p>"
"L<p></p>"
"<p></p>"

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions