Missing Features and Questions About ft.Dropdown
and ft.Switch
#5001
-
QuestionHello! I really like the new Usually, when I need a modal window, I create
Code sampleimport flet as ft
def main(page: ft.Page):
# How can I properly display only the icon while keeping the width of ft.DropdownOption unchanged?
# I would suggest an attribute like `only_icon`.
q1 = ft.Dropdown(
hint_text='Content', text_size=0, width=48,
options=[ft.DropdownOption('dropdown option', content=ft.Switch(label='switch', label_position='left'))],
)
# How can I completely remove `trailing_icon`? Setting `trailing_icon = None` does not work.
q2 = ft.Dropdown(
hint_text='Content', trailing_icon=None, selected_trailing_icon=None,
options=[ft.DropdownOption('dropdown option', content=ft.Switch(label='switch', label_position='left'))],
)
# Can I use `spaceBetween` for ft.Switch to align the toggle and label at opposite ends?
q3 = ft.Dropdown(
hint_text='Content',
options=[ft.DropdownOption('dropdown option', content=ft.Switch(
label='switch', label_position='left', # alignment='spaceBetween'
))],
)
# The animation of the ft.Switch toggle disappears.
q4 = ft.Dropdown(
hint_text='Content',
options=[ft.DropdownOption('dropdown option', content=ft.Switch(label='switch', label_position='left'))],
)
# How can I make the input field expand to the full available space? `expand` did not work for me.
q5 = ft.Dropdown(
hint_text='Content', expand=True,
options=[ft.DropdownOption('dropdown option', content=ft.Switch(label='switch', label_position='left'))],
)
# How can I disable clicking on `ft.DropdownOption` while still handling clicks on `ft.Switch` correctly?
# I would like to set `ft.Dropdown.disabled = True` while keeping the inner element `disabled = False`.
q6 = ft.Dropdown(
hint_text='Content',
options=[ft.DropdownOption('dropdow', disabled=True, content=ft.Switch(disabled=False, label='switch', label_position='left'))],
)
page.add(q1, q2, q3, q4, q5, q6)
ft.app(main) Error messageNo response ------------------------------------------------------
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I can answer a few of your questions:
It will not completely remove the icon, there will still be a button to press, but there will be no icon in it.
|
Beta Was this translation helpful? Give feedback.
I can answer a few of your questions:
menu_width
property. We will add this property for next Flet update and you'll be able to set menu width.