From 926993c1d5b0d4ba80d8a2e87557a73fdb617854 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominique=20W=C3=BCrtz?= Date: Sat, 11 May 2024 11:20:23 +0200 Subject: [PATCH] Do not jump to end of text while editing (fixes #282) --- src/views/text_input.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/views/text_input.rs b/src/views/text_input.rs index a631c270..a9c9df2e 100644 --- a/src/views/text_input.rs +++ b/src/views/text_input.rs @@ -956,7 +956,7 @@ impl View for TextInput { fn update(&mut self, _cx: &mut UpdateCx, state: Box) { if let Ok(state) = state.downcast::<(String, bool)>() { let (_, is_focused) = *state; - if is_focused { + if is_focused && !self.is_focused { self.cursor_glyph_idx = self.buffer.with_untracked(|buff| buff.len()); }