question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Provide an event type on `onEditorChange` prop

See original GitHub issue

Is 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:closed
  • Created 4 years ago
  • Comments:12 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
SimonFccommented, Aug 29, 2019

This has been fixed in 3.3.2. Let me know if you encounter any issues!

2reactions
SimonFccommented, Aug 26, 2019

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!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found