[Question] how do i manage the dropdown value overflow #1934
-
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
import flet as ft ft.app(target=main) |
Beta Was this translation helpful? Give feedback.
import flet as ft
#you can write a program to choose longest text in your dropdown list by comparing there tex len and then multiply the length of the longest text with 8.5 and you will not see textoverflow
def main(page: ft.Page):
options = [ft.dropdown.Option("Option 1"), ft.dropdown.Option("Option 2"), ft.dropdown.Option("Option 3 with a very long text that should wrap")]
dropdown = ft.Dropdown(options=options,width=len("Option 3 with a very long text that should wrap")*8.5,value=options, border_radius=30)
page.add(
ft.Column([dropdown, ])
)
ft.app(target=main)