banyudu / kedao

React 编辑器,从 braft-editor 修改而来,基于 draft-js 实现

Home Page:https://kedao.vercel.app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

banyudu opened this issue · comments

commented

还有如下报错:

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
commented

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

commented

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

commented

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