From bfda870933b2b179e10f2dcac75d710129df6246 Mon Sep 17 00:00:00 2001 From: Stephan Dilly Date: Sat, 4 Jul 2020 15:44:24 +0200 Subject: [PATCH] fix panic when cursor is OOB after closing editor with shorter msg --- src/components/textinput.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/textinput.rs b/src/components/textinput.rs index 8ce8c7a0..4f2bf0f5 100644 --- a/src/components/textinput.rs +++ b/src/components/textinput.rs @@ -89,7 +89,7 @@ impl TextInputComponent { /// Set the `msg`. pub fn set_text(&mut self, msg: String) { self.msg = msg; - //TODO: make sure cursor is in bounds + self.cursor_position = 0; } /// Set the `title`.