-
Notifications
You must be signed in to change notification settings - Fork 218
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
Add IE11 support #61
base: master
Are you sure you want to change the base?
Add IE11 support #61
Conversation
emitChange(evt) { | ||
if (!this.htmlEl) return; | ||
var html = this.htmlEl.innerHTML; | ||
if (this.props.onChange && html !== this.lastHtml) { | ||
evt.target = { value: html }; | ||
this.props.onChange(evt); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You might want to somehow pass the html to onChange!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't it enough to get the whole MutationRecord (=evt
) in onChange? The element's innerHtml
is then accessible via evt.target.innerHtml
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Depends on the node you're getting. In my case I get a text node so evt.target.innerHTML
isn't a thing. Drop document.createTextNode('')
in your console to see what's there.
@lovasoa @notatestuser I re-added |
This was opened a year ago. Any chance this ever gets merged? |
Now using a MutationObserver instead, solution proposed by @notatestuser (#43 (comment)).