Skip to content

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

@davidyuk

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>"

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