How to change the border height of an unfilled or partially filled ft.TextField?
How to set fixed size of field borders. In the current implementation with the width=400 parameter it sets the maximum values of the element size. But the borders change dynamically, depending on the filled text. I want the borders to be static c initially with set size=width. Video demonstration:
entry_message = ft.TextField(label="Message", multiline=True, expand=False, width=400, height=200)
I am not sure what you really want to do. You want the multi-line text field to have a fixed size? If so you can just put a very large number in parameters min_lines
and max_lines
, like the following:
import flet as ft
def main(page: ft.Page):
width = 400
entry_message = ft.TextField(
label="Message",
multiline=True,
min_lines=10000,
max_lines=10000,
width=width,
height=200,
)
recipient = ft.TextField(label="Recipient Name", expand=1)
chat = ft.TextField(label="Chat ID", expand=1)
row = ft.Row([recipient, chat], width=width)
page.add(entry_message, row)
ft.app(target=main)
This will result in the following: