Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Dropdown ignoring expand #5040

Open
1 task done
alieandm opened this issue Mar 6, 2025 · 3 comments · May be fixed by #5042
Open
1 task done

New Dropdown ignoring expand #5040

alieandm opened this issue Mar 6, 2025 · 3 comments · May be fixed by #5042
Assignees
Labels
bug Something isn't working controls

Comments

@alieandm
Copy link

alieandm commented Mar 6, 2025

Duplicate Check

Describe the bug

When adding the new dropdown control to a page, it does not respect the expand property. It will only resize to the longest of its internal elements or a specifically defined width

Code sample

import flet as ft


def main(page: ft.Page):
    
    new_dd = ft.Dropdown(options=[ft.dropdown.Option("Test short"),
                                  ft.dropdown.Option("Test much longer value in box")], expand=1)
    
    old_dd = ft.DropdownM2(options=[ft.dropdown.Option("Test short"),
                                  ft.dropdown.Option("Test much longer value in box")], expand=1)
    
    row = ft.Row([new_dd, old_dd])
    page.add(row)
    


ft.app(main)

To reproduce

Create a new dropdown with the ability to expand into any parent container and set expand = True

Expected behavior

Dropdown expands to fill the parent container

Screenshots / Videos

Image

Operating System

Windows

Operating system details

Windows 10

Flet version

0.27.4

Regression

No, it isn't

Suggestions

No response

Logs

No response

Additional details

Using expand=True and width=float("inf") works for the menu itself, but not the contents - they will then expand to be the full width of the page.

@InesaFitsner InesaFitsner self-assigned this Mar 6, 2025
@InesaFitsner InesaFitsner linked a pull request Mar 6, 2025 that will close this issue
11 tasks
@ndonkoHenri ndonkoHenri added bug Something isn't working controls labels Mar 8, 2025
@cudng
Copy link

cudng commented Mar 23, 2025

It's also ignoring "bgcolor" property

@Abacux
Copy link

Abacux commented Mar 25, 2025

It's also ignoring "bgcolor" property

For your bgcolor issue, the bgcolor property of the new dropdown just change the bgcolor of the options menu. To change the bgcolor of the dropdown:

  1. Set true the new dropdown property: "filled= True"

  2. Establish a bgcolor using the property: fill_color = "#your_color",

But yes there's a bug with the expansion of the new dropdown, even inside of a ResponsiveRow it stay with its default width. Just stablishing a specific width you can change it, but that moves responsiveness to leave the chat lol.

@Amarius1
Copy link

I have also discovered that when expanding the options of the new dropdown they are not animated like before - old dropdown was really nice in that regard. Not sure if that's intended or it can be solved by applying custom animations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working controls
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants