diff --git a/egui/src/widgets/text_edit.rs b/egui/src/widgets/text_edit.rs index b3a37a16e..b2c422508 100644 --- a/egui/src/widgets/text_edit.rs +++ b/egui/src/widgets/text_edit.rs @@ -458,7 +458,8 @@ impl<'t, S: TextBuffer> TextEdit<'t, S> { .or(ui.style().override_text_style) .unwrap_or_else(|| ui.style().body_text_style); let line_spacing = ui.fonts().row_height(text_style); - let available_width = ui.available_width(); + const MIN_WIDTH: f32 = 24.0; // Never make a `TextEdit` more narrow than this. + let available_width = ui.available_width().at_least(MIN_WIDTH); let desired_width = desired_width.unwrap_or_else(|| ui.spacing().text_edit_width); let make_galley = |ui: &Ui, text: &str| {