appflowy-editor icon indicating copy to clipboard operation
appflowy-editor copied to clipboard

[Bug] the cursor will delay by one frame when continuously inputting.

Open LucasXu0 opened this issue 2 years ago • 1 comments

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

LucasXu0 avatar Sep 26 '23 04:09 LucasXu0

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.

LucasXu0 avatar Sep 26 '23 06:09 LucasXu0