Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
useEffect(() => {
const blurHandler = value => {
onBlur && onBlur(value)
};
const changeHandler = value => {
onChange && onChange(value)
};
textArea.current = new Jodit(textArea.current, config);
textArea.current.value = value;
textArea.current.events.on('blur', () => blurHandler(textArea.current.value));
textArea.current.events.on('change', () => changeHandler(textArea.current.value));
textArea.current.workplace.tabIndex = tabIndex || -1;
return () => {
textArea.current.destruct();
textArea.current = textArea.current.element;
}
}, [config]);
mounted () {
this.editor = new Jodit(this.$el, this.editorConfig)
this.editor.value = this.value
this.editor.events.on('change', newValue => this.$emit('input', newValue))
},
this.ngZone.runOutsideAngular(() => {
this.editor = new EditorModule.Jodit(this.element, this.config);
});
}