Please describe the a concise description and fill out the details below. It will help others efficiently understand your request and get to an answer instead of repeated back and forth. Providing a minimal, complete and verifiable example will further increase your chances that someone can help.
Steps for Reproduction
value functions.CTRL+Z for undo.undo just removes that Custom Blot perfect.redo, then it just adds a simple text(from value() function) and does not add CustomBlot back.class MathInputCmp extends Embed {
state = {
mathField: null
};
static create(val) {
const node = super.create();
node.innerHTML = '<span class="input__math__field"></span>';
node.setAttribute('data-latex', val);
node.setAttribute('contenteditable', false);
return node;
}
static value(domNode) {
return domNode.getAttribute('data-latex');
}
static formats(domNode) {
const MQ = window.MathQuill.getInterface(2);
const mathField = MQ.StaticMath(domNode.firstChild);
return {
"data-latex": mathField.latex()
};
}
constructor(domNode, value) {
super(domNode, value);
const MQ = window.MathQuill.getInterface(2);
const mathField = MQ.StaticMath(domNode.firstChild);
mathField.latex(value);
domNode.setAttribute('data-latex', value);
this.state = {
mathField
};
}
value() {
return this.state.mathField.latex();
}
format(name, value) {
if (name === 'data-latex') {
if (value) {
this.domNode.setAttribute('data-latex', value);
} else {
this.domNode.removeAttribute('data-latex');
}
} else {
super.format(name, value);
}
}
}
MathInputCmp.blotName = "MathInput";
MathInputCmp.tagName = "span";
MathInputCmp.className = "input__math";
Quill.register(MathInputCmp, true);
Expected behavior:
Actual behavior:
Platforms:
Google Chrome 72.0
Using this on react
react-quill: 1.3.3
quilljs: 1.2.6
Version:
quilljs: 1.2.6
Similar problem. For me though, undo restores the custom blot with the word true, no matter what was in there before.
I am on 2.0.0-dev.3.
@felix-voicehub, so undo/redo is not working for you as well?
At least not with the correct value in the blot, yes.
Similar problem. For me though,
undorestores the custom blot with the wordtrue, no matter what was in there before.I am on
2.0.0-dev.3.
same here!
I'm trying to undo a deleted custom DOM element and it returns boolean true.
so that I've checked undo stack and it always "true"
but i'm work with react-quill
I also encounter this problem. We need get a complete delta information when excute 'undo' operation. Or whole node is also accepted.
Most helpful comment
I also encounter this problem. We need get a complete delta information when excute 'undo' operation. Or whole node is also accepted.