Skip to content

Commit bfda870

Browse files
author
Stephan Dilly
committed
fix panic when cursor is OOB after closing editor with shorter msg
1 parent 756c124 commit bfda870

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/components/textinput.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ impl TextInputComponent {
8989
/// Set the `msg`.
9090
pub fn set_text(&mut self, msg: String) {
9191
self.msg = msg;
92-
//TODO: make sure cursor is in bounds
92+
self.cursor_position = 0;
9393
}
9494

9595
/// Set the `title`.

0 commit comments

Comments
 (0)