-
Notifications
You must be signed in to change notification settings - Fork 109
Fix issues with updating props #23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix issues with updating props #23
Conversation
|
Would fix #21, thanks @jonathaningram for the inspiration. |
- A simple content change was causing a complete re-render - Altering id prop was not initiating re-_init causing a selector mis-match - Initiating re-_init was not cloning the new props, _init was then adding new properties and triggering false re-renders
62ff95f to
4b5fca8
Compare
|
Edit: but your change is slightly different to mine, so in the end you may not need the cursor change I added... @JasonTolliver you may want to update it to correct the cursor: Without those added lines, when you focus into the editor and start typing, after the first character, the cursor will jump back to the start causing the result to look like this (after typing "Foobar"): |
|
Great call @jonathaningram! JasonTolliver@5244313 |
- Because TinyMCE is completely handling its own inner state, you cannot compare nextProps.content with this.props.content. Instead you must compare with editor.getContent()
|
One more fix added to this in cc24267, because TinyMCE is completely handling its own inner state, you cannot compare |
|
any chance of a merge, outstanding since Jan? |
|
I'm looking forward to see this merged too. |
|
It'd be great if @JasonTolliver could update his fork with latest version so that we could use his fork meanwhile. |
Fixes this bug: instructure-react#23 Remove fork if this PR is merged
|
I pushed a package to npm including this commit if anyone wants to use it. https://www.npmjs.com/package/@realgeeks/react-tinymce |
|
@kevin1024 thank you :-) |

idprop was not initiating re-_init causing a selector mis-match_initwas then adding new properties to the non-bound props and triggering false re-renders