flet icon indicating copy to clipboard operation
flet copied to clipboard

Dropdown bgcolor don't work during displaying the options ?

Open ewribeiro opened this issue 2 years ago • 1 comments

Discussed in https://github.com/flet-dev/flet/discussions/1190

Originally posted by ewribeiro March 17, 2023

Question

How to change the background color of a dropdown option selection menu? I used bgcolor and color but it didn't affect the selection menu. After clicking on the option the colors are as expected, but not while displaying the options. This part displayed in gray color I want to leave in green color. image image

https://user-images.githubusercontent.com/19910316/226013578-12beae90-9cf8-4811-94f2-ed22f55225ef.mp4

Code sample

import flet as ft


async def main(page: ft.Page):
    page.bgcolor = '#024135'
    dd = ft.Dropdown(
        width=100,
        bgcolor='#024135',
        color='white',
        options=[
            ft.dropdown.Option(text='Option 1'),
            ft.dropdown.Option(text='Option 2'),
        ],
    )
    await page.add_async(dd)


ft.app(target=main)

Error message

No response

------------------------------------------------------

  • [X] I have searched for answers to my question both in the issues and in previous discussions.

ewribeiro avatar Mar 19 '23 22:03 ewribeiro

Also mentioned in #1181

Zvetkov avatar Mar 20 '23 14:03 Zvetkov

A pre-release with the fix concerning this issue is now available. Try it and report if you face any further issues or have any questions:

pip install flet --pre

ndonkoHenri avatar Apr 01 '24 22:04 ndonkoHenri