Provide an event type on `onEditorChange` prop
See original GitHub issueIs your feature request related to a problem? Please describe.
The Editor react component provides a prop called onEditorChange
and it fires when a change occurs in the editor.
The problem: when the change occurs I don’t know which event occured. eg.: blur, change, focus, etc.
I have some situations that I need to send a API request only when the text has changed, but the onEditorChange
prop does not provide an argument especifying the event type.
Describe the solution you’d like
The onEditorChange
prop should provide a new argument telling the event type.
onEditorChange={(text, editor, event)}
Describe alternatives you’ve considered
Is there a way to detect the event type using the second argument editor
provided by the onEditorChange
prop?
Issue Analytics
- State:
- Created 4 years ago
- Comments:12 (6 by maintainers)
Top Results From Across the Web
I am using react-tinymce and its onChange prop is not working ...
TinyMCE has onEditorChange event so you can use this like following: ... Here's the code I'm using to get the current text value...
Read more >React integration | Docs - TinyMCE
The onEditorChange prop is used to provide an event handler that will be run when any change is made to the editor content....
Read more >@tinymce/tinymce-react | Yarn - Package Manager
Added CommentChange to the list of events that trigger the onEditorChange handler. Source the tinymce object from the window associated with the target...
Read more >Deprecated - CKEditor 4 Documentation
It provides a deep integration of CKEditor 4 and React that lets you use ... to bind any event handler to the editor...
Read more >Forms and Events - React TypeScript Cheatsheets
If performance is not an issue (and it usually isn't!), inlining handlers is easiest as you can just use type inference and contextual...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This has been fixed in 3.3.2. Let me know if you encounter any issues!
Yeah I see what you mean. Even though it seems to be native behavior to fire the change events on blur, onEditorChange should be restricted to only fire when the content actually changes. I’ll re-open this issue, no need to create a new one!