Cannot paste HTML in IE
See original GitHub issueWhen pasting HTML in IE, only plain text is preserved.
To reproduce:
- Copy some HTML with formatting (such as this line) to the clipboard.
- Go to http://facebook.github.io/draft-js/ in IE.
- Paste the clipboard contents into the editor.
- Expected result: the formatting is preserved.
- Actual result: The formatting is lost.
IE does not expose text/html
on the clipboardData, so this may be difficult to fix. There are working workarounds, though, such as the one described on http://stackoverflow.com/a/6804718/815176. This workaround involves:
- temporarily stashing the current editor contents
- allowing the browser to natively paste into the contenteditable area
- reading the contents of the contenteditable area
Would such a workaround be considered for inclusion in the framework?
Issue Analytics
- State:
- Created 7 years ago
- Comments:15 (8 by maintainers)
Top Results From Across the Web
HTML copy paste not working in OWA for Exchange 2013 SP1 ...
In IE, go Tools>Internet Options>Security tab, click "Reset all zones to default" to reset your IE security settings back to their default ...
Read more >Cannot paste text into form in IE - InfoPath Dev
The issue is that i cannot paste any text that i copied into that rich text box. I tried using ctrl+v as well...
Read more >Copy/Paste function not working in Internet Explorer - ProZ.com
I found today that I could not paste anything from Internet Explorer. I select text in the normal way, click Edit/Copy,
Read more >Help! I Can't Copy Paste In Internet Explorer 11 - Cyn Mackley
If you need to copy/paste something ASAP, try switching to another browser like Firefox or Google Chrome. You can download either one for...
Read more >Fix Copy and Paste Not Working in Chrome - Technipages
If you can't use the copy-paste option in Chrome, disable your extensions, clear the cache and update the browser. On the other hand, ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’m going to try and look into this. Thanks to those who have posted - please let me know if someone has a PR ready for this, otherwise will be debugging it in my spare time.
@AnilRedshift great to hear that other people are working on this as well! My own solution, similar to yours, is implemented in https://github.com/robbertbrak/draft-js/commit/3aee43f060a745d8ff379f7b698f1d7e10d5e06b.
I ran in the same issues that you mentioned. In addition, and just for reference, I noticed that Draft adds the following CSS to the contenteditable div:
-webkit-user-modify: read-write-plaintext-only
(see https://github.com/facebook/draft-js/blob/master/src/component/base/DraftEditor.css#L17). I’m not sure why that attribute is necessary for Draft, but if it’s there, it prevents Edge from pasting HTML into the element.