facebookarchive / draft-js

A React framework for building text editors.
https://draftjs.org/
MIT License
22.58k stars 2.64k forks source link

"Writer.com" Chrome plugin causes errors when pasting text #3141

Open emilyeisenberg-cricket opened 2 years ago

emilyeisenberg-cricket commented 2 years ago

Do you want to request a feature or report a bug?

Bug

What is the current behavior?

Pasting plain text into a Draft.js input box while the Writer.com plugin is enabled causes errors. I tested this using the Writer.com plugin (from https://chrome.google.com/webstore/detail/writer/hngnkmianenpifegfoggnkamjnffiobn/related?hl=en-US) in Chrome.

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem.

Install the Writer.com plugin. Visit https://draftjs.org/. Paste the following text into the example rich text editor at the bottom of the page: "Hello, world!". See that the page crashes with the following error:

DOMException: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node.

draft-error

What is the expected behavior?

The text "Hello, world!" is pasted into the editor

Which versions of Draft.js, and which browser / OS are affected by this issue? Did this work in previous versions of Draft.js?

I experienced this with Draft.js version 0.11.7 as well as whatever version is on the Draft.js homepage. I am using Chrome version 101.0.4951.41101.0.4951.41 on macOS 12.3.1 on an M1 mac. I am using version 1.65.0 of the Writer.com plugin.

I'm fine if this is closed because this seems to be more an issue with the plugin than with Draft.js, but I thought I'd report it anyways. It seems to have been a recent change in the plugin because we have not changed Draft.js versions in a while and the user who was having this problem said they had the plugin installed for many months prior to this becoming an issue.