You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
editor.keyboard.addBinding({key: "Backspace",handler: function(range){console.log("Custom backspace handler");console.log(range);if(range.length>0){// Never execute!!!// If text is selected, apply red color to the selection instead of deletingeditor.formatText(range.index,range.length,"color","red");}else{// If no text is selected, apply red color to the character before the cursorletformat=editor.getFormat(range.index-1,1);if(format.color==="red"){// If already red, remove it (toggle behavior)editor.formatText(range.index-1,1,"color",false);}else{// Apply red coloreditor.formatText(range.index-1,1,"color","red");}}returnfalse;// Do not delete the character/text},});
Expected behavior:
All backspace events are captured
Actual behavior:
It is captured only if there is no check, and the handler is not executed if there is a check.
Steps for Reproduction
Expected behavior:
All backspace events are captured
Actual behavior:
It is captured only if there is no check, and the handler is not executed if there is a check.
Platforms:
MacOS: 13.4.1
Chrome: "123.0.6xxxx"
"quill": "2.0.0-rc.5"
"React": "18.2.0"
Include browser, operating system and respective versions
Version:
Run
Quill.version
to find outThe text was updated successfully, but these errors were encountered: