-
Notifications
You must be signed in to change notification settings - Fork 590
fix: Dropdown text not clearing when its value is reset
#5800
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We've reviewed this pull request using the Sourcery rules engine
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR improves the Dropdown control implementation with better synchronization between the text controller and value changes, along with documentation improvements.
- Enhanced text controller synchronization to prevent unwanted text change events during programmatic updates
- Improved null safety handling for dropdown options with explicit validation
- Updated Flutter API usage from deprecated
withOpacitytowithValues
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| sdk/python/packages/flet/src/flet/controls/material/dropdown.py | Reformatted docstrings for better clarity and consistency, fixed example to use ft.DropdownOption instead of ft.dropdown.Option |
| packages/flet/lib/src/controls/dropdown.dart | Added state tracking for value changes, implemented text suppression mechanism, improved option validation with null handling, and updated deprecated color API |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
sdk/python/packages/flet/src/flet/controls/material/dropdown.py
Outdated
Show resolved
Hide resolved
Deploying flet-docs with
|
| Latest commit: |
8e6098e
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://2b6ef21b.flet-docs.pages.dev |
| Branch Preview URL: | https://fix-dropdown-clear.flet-docs.pages.dev |
|
Notes:
|
Fix #5119
Example
Summary by Sourcery
Fix dropdown text not clearing on value reset, improve state synchronization and refactor item-building logic
Bug Fixes:
Enhancements:
Documentation: