question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Deletion bug in Firefox causes error/crash

See original GitHub issue

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

bug

What is the current behavior?

I can only recreate this issue in Firefox which seems to be the only browser with a “Delete” option in the context menu.

https://jsfiddle.net/wa2ckjq4/8/

Highlight the five rows saying “Delete me”. Right click and choose “Delete” from the context menu.

Whole page crashes with console logs:

DOMException: "Node was not found" react-dom.production.min.js:110:57
NotFoundError: Node was not found

I may be mistaken but it appears to relate to setting an initial value in the constructor. Without that, I haven’t been able to reproduce this issue.

What is the expected behavior?

For the page not to crash

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

Firefox 61.0.1 (64 bit) Draft v0.10.5 React v16.4.1

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
MattSchillercommented, Feb 5, 2020

Following up here for the Draft team & future bug-sufferers.

Recapping the issue:

  • We had a stateful component that leveraged the editorState to handle user input. When the user submitted a form, we wanted to clear the content. using EditorState.createEmpty/createWithContent worked fine to refresh this view in Chrome. In Firefox, it caused some problem internal to DJS which crashed the app around it.

Workaround/Acceptable solution:

  • Simply leverage the following to replace the text in place, maintaining the editorState object and apparently side-stepping Firefox’s bug:
EditorState.push(
  editorState,
  Modifier.replaceText(
    editorState.getCurrentContent(), 
    {{ SelectionState instance of entire editor text }},
    ''),
    'replace-text'
)
{{ forceSelecting the cursor to the start of the content }}

I hope this helps someone 🙇

0reactions
mrkevcommented, May 20, 2020

This is part of a whole set of errors that stem from the process of keeping React and the DOM in sync, when the DOM is edited under React’s feet. Thanks for sharing the knowledge @MattSchiller !

Read more comments on GitHub >

github_iconTop Results From Across the Web

Firefox keeps crashing at startup | Firefox Help - Mozilla Support
If Firefox keeps crashing when you try to start it and other solutions don't work, a clean reinstall can often fix the problem....
Read more >
Firefox crashes and can't use the existing profile when ...
When I relaunched Firefox, I got the above error message. Luckily I use Sync, so my many bookmarks are backed up. But of...
Read more >
Uninstalled Mozilla but it continues to crash. | Firefox Support ...
I was having some trouble with Windows Media player and the mods from Microsoft that because it was a BEX error it could...
Read more >
Cannot delete account following suspected hack Keep getting ...
Enter about:crashes in the Firefox address bar and press Enter. A list of Submitted/Unsubmitted Crash Reports will appear, similar to the one ...
Read more >
Firefox had a problem and crashed. We'll try to restore your ...
If you can exit without restarting, please try Firefox's Safe Mode. In its Safe Mode, Firefox temporarily deactivates extensions, hardware ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found