I am using React Quill as the text editor. This works fine until I add the custom image handler. If I add the image handler as below, I can't type into the editor. Typing lose focus on every single keypress.
const modules = {
toolbar: {
container: [
[{'header': [3, 4, 5, 6, false]}],
['bold', 'italic', 'underline', 'strike', 'blockquote', 'code'],
[{color: []}, {background: []}],
[{'list': 'ordered'}, {'list': 'bullet'}, {'indent': '-1'}, {'indent': '+1'}],
['link', 'image'],
['clean']
],
handlers: {
image: imageHandler
}
},
clipboard: {
// toggle to add extra line breaks when pasting HTML:
matchVisual: false,
}
};
function imageHandler() {
console.log("custom image handler");
}
If I comment out the image: imageHandler
, editor works perfectly. Here is the codesanbox example
Am I writing the custom module correctly?