Skip to content

[Question] how do i manage the dropdown value overflow #1934

Answered by plugeit
Alejandrotr22 asked this question in Q&A
Discussion options

You must be logged in to vote

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)

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@Alejandrotr22
Comment options

@plugeit
Comment options

@plugeit
Comment options

Answer selected by Alejandrotr22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
help wanted Extra attention is needed
2 participants