flet-dev / flet

Flet enables developers to easily build realtime web, mobile and desktop apps in Python. No frontend experience required.
https://flet.dev
Apache License 2.0
11.5k stars 449 forks source link

Small bug with TextField: bad behaviour with suffix/prefix properties. #4161

Closed ClearSafety closed 1 month ago

ClearSafety commented 1 month ago

Duplicate Check

Describe the bug

When one uses the properties 'suffix' or 'prefix' of the TextField control, it increases slightly the height of the field and it makes its content descentralised. The same doesn't happen with the properties 'suffix_icon' or 'prefix_icon'. The attached image shows the difference.

Code sample

Code ```python import flet as ft def main(page: ft.Page): txtfield = ft.TextField( width=400, value='Default value', text_size=10, bgcolor=ft.colors.AMBER_100, text_vertical_align=ft.VerticalAlignment.CENTER, suffix_icon=ft.icons.ARROW_DROP_DOWN #suffix=ft.Icon(name=ft.icons.ARROW_DROP_DOWN), ) page.add(txtfield) ft.app(target=main) ```

To reproduce

Run the repro code. To test the difference, comment 'suffix' property.

Expected behavior

No response

Screenshots / Videos

Captures [Upload media here]

textfield

Operating System

Windows

Operating system details

Windows 11 Pro

Flet version

0.24.1

Regression

No, it isn't

Suggestions

No response

Logs

Logs ```console [Paste your logs here] ```

Additional details

No response