How to add onKeyup and onPaste events in Jodit-react?
Jodit Version: 3.4.xxxxx
Browser: OS: Is React App:
const [editorData, setEditorData] = useState(value);
const [showEditor, setShowEditor] = useState<boolean>(false);
const config = useMemo(() => ({ readonly: false, showCharsCounter: false, showWordsCounter: false, showXPathInStatusbar: false, height: '300', toolbarAdaptive: false, buttons: richTextEditorConfig(), uploader: IMAGE_UPLOAD, askBeforePasteFromWord: false, askBeforePasteHTML: false, popup: { // removing the file upload option from hyperlink a: markAsAtomic([ { name: 'eye', tooltip: 'Open link', exec: (editor: any, current: any) => { const href = current.href;
if (current && href) {
editor.ow.open(href);
}
},
},
{
name: 'link',
tooltip: 'Edit link',
},
'unlink',
]),
},
}), []);
{showEditor ? <Box> <JoditEditor value={editorData} config={config} onBlur={(newContent: any) => handelRichTextContent(newContent)} /> </Box> : <Box className={isExpandedView ? classes.editorSection : classes.minTileEditor} dangerouslySetInnerHTML={{ __html: editorData }}></Box>}
How to handel onKeyup and onPaste events?
Expected behavior: need to handel onKeyup and onPaste events Actual behavior: unable to handel onKeyup and onPaste events
Just add them through the event mechanism of Jodit itself
const config = useMemo(() => ({
events: {
keyup: (e) => console.log(e),
paste: (e) => console.log(e),
}
});
Thank you