input: Pause blink and keep show cursor on moving or editing. (#1236)

https://github.com/user-attachments/assets/751d0b62-18f9-41c8-80a0-e11439e3b91e
This commit is contained in:
Jason Lee 2025-09-10 14:49:14 +08:00 committed by GitHub
parent 43c848893c
commit 5beaed2a9e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 0 deletions

View file

@ -70,6 +70,7 @@ impl BlinkCursor {
/// Pause the blinking, and delay 500ms to resume the blinking.
pub fn pause(&mut self, cx: &mut Context<Self>) {
self.paused = true;
self.visible = true;
cx.notify();
// delay 500ms to start the blinking

View file

@ -2082,6 +2082,8 @@ impl EntityInputHandler for InputState {
return;
}
self.pause_blink_cursor(cx);
let range = range_utf16
.as_ref()
.map(|range_utf16| self.range_from_utf16(range_utf16))