scniro / react-codemirror2

Codemirror integrated components for React
MIT License
1.65k stars 192 forks source link

[Question] How to get the code inside codemirror on Onblur Operation #258

Closed Abhishek-kumar09 closed 2 years ago

Abhishek-kumar09 commented 2 years ago

https://stackoverflow.com/questions/68839005/how-to-get-the-code-inside-codemirror-on-onblur-operation

Actuallly using onChange operation to get the code is very expensive in my application. I want to get the code when the user has done editing the texts and now get out of focus. I want to change the state at that time.

One problem I am facing is I could not get the code written inside it in onBlur event. How can I get that?

Abhishek-kumar09 commented 2 years ago

Just got the way to do this. Answer: https://stackoverflow.com/questions/68839005/how-to-get-the-code-inside-codemirror-on-onblur-operation

Abhishek-kumar09 commented 2 years ago

I am closing this to manage other important issues for now. But feel free to give your remarks and reopen if there is some changes or other better methods.