-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Custom blots cause a mutation error on undo/redo #2312
Comments
@Ravenstine After having a look into the sources I found a dirty workaround that fixes the issue for me: I'm manually adding the new blot name of the inline element to the
see: https://github.com/quilljs/quill/blob/develop/blots/inline.js#L49-L59 |
@Ravenstine try to add additional condition into if statement blot.domNode[Registry.DATA_KEY] && |
I just had the same issue. It will be good to have a solution from the @toao thanks for the workaround. It did the job for me. |
This issue also affects simply enabling/disabling blots. In my case, after enabling 3 custom Inline blots by clicking on the toolbar control, then clicking again to disable them after the 2nd one I get this error. Like, others, the solution here fixed it for me too. |
Is it related to #2524? |
@toao The trick works for me. However, it doesn't work if I have multiple instances of the editor on the same page. |
Meanwhile the project where I used this hack was abandoned 😅, but I quickly dug out the code and it looks like this:
An own "Small" blot was defined and then manually inserted into the list. Not sure what's different when you have multiple instances, maybe it causes a reset to the defaults each time, so maybe doing the change at the very end (when everything is loaded) might help. |
Thanks you, @toao 👍 |
I re opend this, i have the same issue. |
Quill 2.0 has been released (announcement post) with many changes and fixes. If this is still an issue please create a new issue after reviewing our updated Contributing guide 🙏 |
When I create custom blocks, no matter what tag name I use, I get the following error when doing things like undo and toggling formats:
Steps for Reproduction
foo
.bar
.Expected behavior:
No mutation errors and the undo history remains intact.
Actual behavior:
Mutation error occurs and it seems like the undo history is often messed up once the error happens.
Platforms:
Chrome 69.0.3497.92 on macOS High Sierra.
Version:
1.3.6
The text was updated successfully, but these errors were encountered: