Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unresponsive editor due to normalization on paragraph with lots of inline nodes #3430

Open
DanweDE opened this issue Jan 15, 2020 · 1 comment

Comments

@DanweDE
Copy link

DanweDE commented Jan 15, 2020

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

A bug

What's the current behavior?

Performance while editing documents with paragraphs that have lots of inline elements becomes really bad really quickly.

Sandbox (used also in the following gifs): codesandbox.io here (just try to type a sentence)
This following gif shows how slow copy pasting junks of such a document can be.

slow-single-paragraph-lots-of-inline

Even worse though is typing and deleting single letters via backspace, which can take really long. The following gif is not ideal as you can't see my key strokes but you should get an idea:

slow-single-paragraph-lots-of-inline-test-writing

From what I understand, this is due to current normalization performance, but I could be wrong. Workarounds would also appreciated if anything is known.

OS, Versions, etc.

I am using latest Slate 57.1 (as can be seen in the sandbox) and Chromium 79.0 on recent Manjaro Linux on a high-end mobile workstation laptop (I saw the same issue on other systems like a Mac as well)

What's the expected behavior?

Interacting with such a document should still be responsive and offer a good user experience.

@ryanmitts
Copy link
Contributor

@ianstormtaylor

Removing this line on the text node memoization check fixes this issue.

Each time a key is pressed in a paragraph, that paragraph element is not equal to the old one, and every single one of its text nodes re-renders. I'm not sure if this check is accounting for any situation?

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

No branches or pull requests

2 participants