Skip to content
This repository has been archived by the owner on Feb 6, 2023. It is now read-only.

Backspace usage performance problem #1259

Open
SergeyOkishev opened this issue Jun 23, 2017 · 2 comments
Open

Backspace usage performance problem #1259

SergeyOkishev opened this issue Jun 23, 2017 · 2 comments
Assignees

Comments

@SergeyOkishev
Copy link

SergeyOkishev commented Jun 23, 2017

Do you want to request a feature or report a bug?
Bug
What is the current behavior?
Using "backspace" button is much slower than using "delete" button, especially when removing emptylines.
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. Go to https://draftjs.org/ theres example editor to work with.
  2. Add many empty lines ("\n"), two-three screens is enough
  3. Select last line and keep "backspace" button pressed.
  4. Browser would freeze and work veeery slowly until there only 10-20 empty lines left.
  5. Try same think, but starting from the first line and keeping "delete" button pushed. It would go smoothly
    What is the expected behavior?
    Backspace and delete buttons should have same performance (as fast as with "delete" button)
    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
    Appears on Firefox/Chrome. Firefox version is much much slower. Guess IE/Safary would be even slower.
    Tested on linux, but don`t think that matters.

I think problem could be inside "onBackspace" handler, but i didn't read that part of code deeply, can't be sure for now.

P.S. Excuse me for gramma, hoping you understand me clearly.

@lemmih
Copy link
Contributor

lemmih commented Oct 13, 2017

Fixed by #1429

@flarnie flarnie self-assigned this Oct 14, 2017
@jurosh
Copy link

jurosh commented Jan 27, 2018

...but still looks like removing characters is taking much more time than writing them - best to try on large document where holding backspace/delete will freeze app using Draft.js... not sure if it's some constraint in design to make it work same as typing?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants