Closed dave-handy closed 8 years ago
Would gladly accept a PR for this.
I should note that I am not doing anything special to handle onChange, or any other event. This component is simply a React wrapper for tinymce. This module only proxies all the events. So if you're having a problem with events not firing often enough, it is likely an issue with tinymce itself.
Now that I'm thinking through this further, you don't need onChange if you have:
That's actually a better approach than I had planned when I thought onChange would work ;)
Maybe just a note in the README.md to warn about onChange?
Sounds like you've got it figured out. Okay to close this?
I'm having the same issue that onChange is only fired on blur, and I need this to also fire when a key is entered (e.g. like with the onkeyup event).
I have tried adding the same callback as I did to onChange, but for onKeyup, however the event it's passing as an argument points to a different target than what onChange does, so I'm getting this issue on keyup:
Uncaught TypeError: e.target.getContent is not a function
How do I get this working? I've also tried the onNodeChange event, but that seems to only work when I do backspace, not when actually typing letters
@amcsi I ran into the same issue but after going through source i figured out the solution i describe here: https://github.com/instructure-react/react-tinymce/issues/41#issuecomment-262758123
hope it helps.
@w- thanks for the hint. Works for me :)
It seems that onChange is only fired when you change the cursor location in the document, not whenever the document content changes (as you type). I expected any changes in the text to receive a callback.