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

BUG: 快速 backspace 删除时编辑器无响应 #41

Open
banyudu opened this issue Sep 22, 2022 · 3 comments
Open

BUG: 快速 backspace 删除时编辑器无响应 #41

banyudu opened this issue Sep 22, 2022 · 3 comments
Labels
bug Something isn't working

Comments

@banyudu
Copy link
Owner

banyudu commented Sep 22, 2022

还有如下报错:

Uncaught TypeError: Cannot read properties of undefined (reading 'getIn')
    at 597.4c6c7297.js:formatted:4375:54
    at 597.4c6c7297.js:formatted:11875:21
    at Gt.iterate.Yt.iterate (597.4c6c7297.js:formatted:12226:32)
    at Ut.__iterate (597.4c6c7297.js:formatted:11873:49)
    at Ut.forEach (597.4c6c7297.js:formatted:14078:26)
    at Object.resolveComposition (597.4c6c7297.js:formatted:4370:27)
    at 597.4c6c7297.js:formatted:4345:28
@banyudu
Copy link
Owner Author

banyudu commented Sep 23, 2022

另外删除时屏幕会刷一下,有可能是相同的问题

@banyudu
Copy link
Owner Author

banyudu commented Sep 24, 2022

删除时屏幕刷一下的原因是有 forced reflow

@banyudu
Copy link
Owner Author

banyudu commented Sep 26, 2022

本项目中的 Controlbar 等内部涉及到 forced reflow 已优化,但是问题并没有解决。
原因在于 draft-js 内部对 focus / blur / backspace 等操作都会有一个内部的 update 事件,触发了一次重新渲染。
对比了一下 react-draft-wysiwyg 也存在类似问题。

@banyudu banyudu added the bug Something isn't working label Sep 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant