facebookarchive/draft-js

Edge case - Paste doesn't remove current selection before mouseup

Open

#991 aberto em 31 de jan. de 2017

Ver no GitHub
 (4 comments) (1 reaction) (0 assignees)JavaScript (2.646 forks)batch import
bughelp wanted

Métricas do repositório

Stars
 (22.554 stars)
Métricas de merge de PR
 (Nenhuma PRs mesclada em 30d)

Description

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

What is the current behavior? Editor does not remove selection when pasting unless mouseup has fired (it seems that a selection isn't registered until mouseup). I use a trackpad with 3 finger drag, which has a 300-ish millisecond delay after lifting. If I paste text in that window, the following behavior occurs:

draft-js

Basically, the repro steps are:

  1. Click and drag a selection
  2. Press cmd-P before mouseup

What is the expected behavior? Paste removes currently selected text (potentially not possible). Perhaps it could disallow pasting before mouseup?

Honestly, even OS X gets this wrong. Try the same steps on the location bar.

Which versions of Draft.js, and which browser / OS are affected by this issue? Did this work in previous versions of Draft.js? DraftJS: 0.10.0 Browser: Chrome 56 OS: Mac OS X 10.12.2

Guia do colaborador