Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃悰 Text alignment in TextBox depends on placeholder #1027

Open
robkri opened this issue Feb 21, 2024 · 0 comments
Open

馃悰 Text alignment in TextBox depends on placeholder #1027

robkri opened this issue Feb 21, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@robkri
Copy link
Contributor

robkri commented Feb 21, 2024

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.

@bdlukaa bdlukaa added the bug Something isn't working label Feb 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants