facebookarchive/draft-js

moveSelectionBackward warning in production

Open

#1 840 ouverte le 20 août 2018

Voir sur GitHub
 (5 commentaires) (2 réactions) (0 assignés)JavaScript (2 646 forks)batch import
help wanted

Métriques du dépôt

Stars
 (22 554 stars)
Métriques de merge PR
 (Aucune PR mergée en 30 j)

Description

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

What is the current behavior? backspacing in the editor causes the following warning in dev environment:

Draft.js:5665 Warning: moveSelectionBackward should only be called with a collapsed SelectionState

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem. You can use this jsfiddle to get started: https://jsfiddle.net/stopachka/m6z0xn4r/.

  1. Open the official tweet.html example.
  2. Type "abcdefg"
  3. Press backspace Observe each time backspace is pressed there is a warning in the console log.

The warning is only shown in dev env. I haven't found any user facing issue caused by this.

What is the expected behavior? Shouldn't have warning in console log.

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

There isn't this warning on the master of May 16, 2018, so it could be a regression.

Guide contributeur