date_field icon indicating copy to clipboard operation
date_field copied to clipboard

Fix empty value to resolve hintText layout issue

Open mwoelk opened this issue 10 months ago • 0 comments

Changed how empty values are displayed.

Currently, if no date is given, a SizedBox is rendered. Instead, a Text with an empty string should be rendered. The difference is that an empty SizedBox has a height of 0 whereas the empty Text height corresponds to the line height of the text. This is a better suited placeholder as the height will always stay the same if there is or isn't a value present.

This fixes issues with the display of e.g. hintText when no label is given as it would otherwise result in different field sizes or when using outlined fields, the hintText would be misplaced.

Before: Screenshot 2024-04-26 at 15 42 07

After: Screenshot 2024-04-26 at 15 43 02

mwoelk avatar Apr 26 '24 13:04 mwoelk