bdlukaa / fluent_ui

Implements Microsoft's WinUI3 in Flutter.

Home Page:https://bdlukaa.github.io/fluent_ui/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

πŸ› Text alignment in TextBox depends on placeholder

robkri opened this issue Β· comments

The alignment of the text inside a TextBox changes depending on whether or not the TextBox is given a placeholder text. If any String is passed to placeholder (even an empty String), the text gets aligned vertically centered. Otherwise it's aligned at the top of the TextBox. This is barely recognizable in the first two examples where the difference is only about 1px, but shows very clearly when TextBox expands in a larger parent:
grafik

To reproduce

Column(
      children: [
        SizedBox(child: TextBox()),
        SizedBox(height: 16),
        SizedBox(child: TextBox(placeholder: "")),
        SizedBox(height: 16),
        SizedBox(height: 50, child: TextBox()),
        SizedBox(height: 16),
        SizedBox(height: 50, child: TextBox(placeholder: "")),
      ],
    )

Expected behaviour
The text inside a TextBox with maxLines = 1 is always vertically centered.