flet
flet copied to clipboard
Dropdown bgcolor don't work during displaying the options ?
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.

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.
Also mentioned in #1181
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