lovasoa / react-contenteditable

React component for a div with editable contents
http://npmjs.com/package/react-contenteditable
Apache License 2.0
1.63k stars 218 forks source link

IE 11 not supported #43

Open blackbing opened 7 years ago

blackbing commented 7 years ago

related issue:

blackbing commented 7 years ago

send pr for solving this. https://github.com/lovasoa/react-contenteditable/pull/44

blackbing commented 7 years ago

@lovasoa I am looking for the IE support solution for this.

Here is a simple idea about solving this problem.

  1. use keyup event instead if IE browser.
  2. also handle paste event.

And you mentioned We can simply shadow the target if it can't be overwritten. in here. Can you give me some hint about this? I'll make PR ASAP because my project need this support IE.

stahlmanDesign commented 7 years ago

I don't know if this helps but on some React input components I use onInput instead of onChange so that IE11 behaves like all other browsers. Apparently onChange will work as expected in IE when Fiber a.k.a React v16.0 comes out.

slorber commented 7 years ago

@stahlmanDesign can you provide an example implementation of your solution please?

stahlmanDesign commented 7 years ago

Replace onChange with onInput http://codepen.io/stahlmandesign/pen/JWpNKJ

slorber commented 7 years ago

@stahlmanDesign I don't understand, the project is about a contentEditable div, not a regular input. Also onInput is already what is used: https://github.com/lovasoa/react-contenteditable/blob/master/src/react-contenteditable.js#L17

guillaumepotier commented 7 years ago

Hi there,

What is the status of this one, is this still an open issue for IE11?

Thanks

slorber commented 7 years ago

@guillaumepotier this is supposed to be resolved in React 15.6:

https://facebook.github.io/react/blog/2017/06/13/react-v15.6.0.html https://github.com/facebook/react/pull/8575

guillaumepotier commented 7 years ago

How, that's a good news! I'll test it then when I'll update it. Thanks for your help

rake5k commented 7 years ago

@slorber I just updated to react 15.6.1, but unfortunately, the onChange prop function still doesn't get called in IE11. I hope I'm just doing something wrong...

slorber commented 7 years ago

@christianharke I'm not maintaining this project nor I have upgraded to 15.6.1, if you think it does not work try to reproduce with raw react div and if it does not work fill a bug in react repo

notatestuser commented 7 years ago

@guillaumepotier @christianharke @slorber We are using react v15.6.1 and still had problems with this component in IE11.

I've successfully modified this component to use a MutationObserver with working IE11 support: https://github.com/e1-bsd/omni-common-ui/pull/35/commits/a6031f2db6320e6b85dec60cc1adfb1791ffae56

PLEASE NOTE that the onChange signature is now different and takes the innerHTML directly. Patching the target of the event no longer works as a MutationRecord does not have a target.

MartinDawson commented 6 years ago

Seems to work fine now on React 16 in IE11.

Still broken...

guillaumepotier commented 6 years ago

I confirm this is still broken on IE11 with React and React-dom 1.16.3

Tested @notatestuser change and it works. Could we consider integrating it?

mccambridge commented 6 years ago

Is this repo still supported? Not working on IE 11 for me.

lovasoa commented 6 years ago

Yes, this repo is still maintained. I'd prefer not to merge @notatestuser PR because it breaks the current API. If onInput is not fired, then react should fix it. The issue was closed in react: if it is still present, then they should reopen it and fix it. Please go complain there :) https://github.com/facebook/react/issues/7280

mdshohelrana commented 4 years ago

Hi there,

What is the status of this one, is this still an open issue for IE11?

Thanks