flet icon indicating copy to clipboard operation
flet copied to clipboard

New Dropdown errors

Open jvalle63 opened this issue 1 year ago • 7 comments

Duplicate Check

  • [x] I have searched the opened issues and there are no duplicates

Describe the bug

First error: dense=True is not working Second error: When you clear the dropdown.value (value='' or value = None), the defined option continues appearing... In the previous version, you just had to set value='' (dropdown_name.value=''), for the defined option to disappear, and the dropdown label to reappear. Now nothing happens.

I need both working ASAP. New version is frozen until these bugs are fixed.

Code sample

Code
[status_search=ft.Dropdown(
        label='  Status',
        #width=110,
        text_align=ft.alignment.center_left,
        bgcolor=ft.Colors.WHITE,
        dense=True,
        filled=True,
        fill_color=ft.Colors.WHITE,
        color=ft.Colors.GREY_700,
        border_color=ft.Colors.BLACK,
        border_width=1,
        hint_text='  Status',
        hint_style=ft.TextStyle(size=14,color=ft.Colors.GREY_700,weight="BOLD",font_family='Tahoma'),
        text_style=ft.TextStyle(size=14,color=ft.Colors.GREY_700,font_family='Tahoma'),
        border_radius=1,
        content_padding=1,
        options=[
            ft.dropdown.Option('Pendente'),
            ft.dropdown.Option('Aprovado'),
            ft.dropdown.Option('Reprovado'),
            ft.dropdown.Option('Andamento'),
            ft.dropdown.Option('Finalizado'),
            ft.dropdown.Option('Retirado'),
        ],
        on_change=inputsearch,
        autofocus=True

status_search.value=''
page.update()
        )]

To reproduce

first error: create a dropdown button with dense=True second error: Just create a dropdown menu button and try to clear it's value

Expected behavior

In both problems, nothing happens

Screenshots / Videos

Captures

[Upload media here]

Operating System

Windows

Operating system details

Windows 10

Flet version

0.28.3

Regression

Yes, it used to work in a previous Flet version (please specify the version in additional details)

Suggestions

No response

Logs

Logs
[Paste your logs here]

Additional details

No response

jvalle63 avatar Jun 27 '25 21:06 jvalle63

I found another error. The option selection button does not shrink when using dropdown buttons with Responsive Rows. This causes the width of the button to be much larger so that the text does not wrap.

What's going on, guys? You've regressed functionality instead of evolving it!

Is it best to revert to the previous version? If so, how do I do that?

jvalle63 avatar Jun 28 '25 18:06 jvalle63

Did you find those errors on 0.28.3, or on 0.70.0?

InesaFitsner avatar Jul 01 '25 17:07 InesaFitsner

Did you find those errors on 0.28.3, or on 0.70.0?

Don't you have anything more useful to do than make lame fifth-grade jokes? How about helping fix the bug? Your brain would thank you.

jvalle63 avatar Jul 02 '25 06:07 jvalle63

I found the error in the 0.28.3 version

ingdesarr1 avatar Jul 02 '25 12:07 ingdesarr1

I found the error in the 0.28.3 version Great!

jvalle63 avatar Jul 02 '25 16:07 jvalle63

Use 0.80.5 pip install flet==0.80.5 And try again

mostafa-kessassi avatar Feb 14 '26 01:02 mostafa-kessassi

All three points are covered now, so I'm closing this ticket:

  1. Clearing the value: fixed in 0.80.0 by #5800 (tracked in #5119). Setting dropdown.value = None (or "") and calling update() empties the field and brings the label back, also after the user picked an option.
  2. dense=True has no effect: this is #5047. The trailing arrow button of the Material 3 dropdown sets a minimum height for the field, so dense can't shrink it yet. Please follow #5047 for the fix.
  3. Width inside ResponsiveRow: the field shrinks to fit its column. The open menu is at least as wide as the field and grows to fit the longest option, which is how the Material 3 dropdown works. If you want long options to wrap, set width on the Dropdown; the menu then uses that width and long labels wrap.

If something still looks wrong on 1.0.x, please comment here with a minimal snippet.

ndonkoHenri avatar Nov 02 '26 22:11 ndonkoHenri