Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
davidyuk opened this issue Feb 19, 2017 · 0 comments
Open

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

davidyuk opened this issue Feb 19, 2017 · 0 comments

Comments

@davidyuk
Copy link

davidyuk commented Feb 19, 2017

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>"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant