Skip to content

Commit

Permalink
fix: TextBox text vertical alignment when single line
Browse files Browse the repository at this point in the history
  • Loading branch information
bdlukaa committed Jan 31, 2025
1 parent 22bab9d commit f63803b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/src/controls/form/text_box.dart
Original file line number Diff line number Diff line change
Expand Up @@ -910,7 +910,9 @@ class _TextBoxState extends State<TextBox>
// TextBox has top alignment by default, unless it has decoration
// like a prefix or suffix, in which case it's aligned to the center.
TextAlignVertical get _textAlignVertical {
return widget.textAlignVertical ?? TextAlignVertical.top;
if (widget.textAlignVertical != null) return widget.textAlignVertical!;
if (widget.maxLines == 1) return TextAlignVertical.center;
return TextAlignVertical.top;
}

Widget _addTextDependentAttachments(
Expand Down

0 comments on commit f63803b

Please # to comment.