appflowy-editor
appflowy-editor copied to clipboard
[Bug] the cursor will delay by one frame when continuously inputting.
Bug Description
https://github.com/AppFlowy-IO/appflowy-editor/assets/11863087/0acc61a4-7775-4492-bb38-ad2f092275c2
Record a video and slow down the playback speed to check each frame.
How to Reproduce
continuously inputting.
Expected Behavior
the cursor should be updated after the text finished layouting.
Operating System
All Platform
AppFlowy Editor Version(s)
1.4.3
Screenshots
No response
Additional Context
No response
Reason: the selection area is positioned behind the text. When the text is rebuilt, the selection area is also rebuilt. However, at this point, the text layout hasn't been completed, so it retrieves the wrong position (the previous location) from the text paragraph.
editing text -> text rebuild -> selection area rebuild -> get cursor position(wrong) -> text layout.