Closed marabesi closed 1 year ago
@marabesi https://uiwjs.github.io/react-codemirror/#/extensions/events
import * as events from '@uiw/codemirror-extensions-events';
const extension = events.content({
focus: (evn) => {
console.log('focus');
},
blur: (evn) => {
console.log('blur');
},
});
<CodeMirror value="console.log('hello world!');" height="200px" extensions={[extension]} />
checked with extensions and it worked!
Thanks!
reac-codemirror has the event onFocusChange that I used to use in my project like so:
This is what it does: onFocusChange Function (focused) called when the editor is focused or loses focus.
But I couldn't find a equivalent to use for @uiw/react-codemirror, is there a workaround for this one?