diff --git a/crates/yakui-widgets/src/widgets/textbox.rs b/crates/yakui-widgets/src/widgets/textbox.rs index 5c2ab9b2..877eee8b 100644 --- a/crates/yakui-widgets/src/widgets/textbox.rs +++ b/crates/yakui-widgets/src/widgets/textbox.rs @@ -93,6 +93,9 @@ impl Widget for TextBoxWidget { text = &self.props.placeholder; } + // Make sure the cursor is within bounds if the text has changed + self.cursor = self.cursor.min(text.len()); + let mut render = RenderTextBox::new(text.clone()); render.style = self.props.style.clone(); render.selected = self.selected;