Skip to content

Conversation

FeodorFitsner
Copy link
Contributor

@FeodorFitsner FeodorFitsner commented Aug 24, 2025

Summary by Sourcery

Add a text property and on_select event to the Dropdown control, update the underlying implementations, refactor the properties table logic, and refresh examples to demonstrate both selection and text-change interactions.

New Features:

  • Add text property to Python Dropdown for editable input
  • Introduce on_select event callback in Python Dropdown for selection changes
  • Expose text property and select event in Dart dropdown implementation
  • Include new example apps for reactive dropdown and separate select/text-change events

Enhancements:

  • Refactor properties_table.py to use if/elif blocks, proper None comparisons, and capture event properties in closures
  • Update existing examples to replace on_change with on_select where appropriate

Build:

  • Bump Python requirement to >=3.10 in controls-gallery pyproject.toml

Deleted the before_update method in the Dropdown class, which previously set expand_loose based on expand. This change may address redundant or obsolete logic related to display issues.
Introduces a new example demonstrating a reactive dropdown control in Flet. The example uses a dataclass to manage state and updates the selected color dynamically.
Renamed Dropdown event handlers from on_change to on_select and on_text_change to on_change for clarity and consistency. Updated related property names from 'value' to 'text' where appropriate, and improved documentation for several Dropdown properties. Added a new example demonstrating both select and change events.
Copy link
Contributor

@sourcery-ai sourcery-ai bot left a 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

Copy link
Contributor

@Copilot Copilot AI left a 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 enhances the Dropdown control by adding a text property for editable input fields and separating selection events from text change events. The PR introduces the on_select event specifically for dropdown selection changes while repurposing on_change for text input changes.

  • Add text property to track editable text input separately from selected value
  • Separate on_select event for dropdown selections from on_change for text changes
  • Update documentation for previously undocumented properties

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
dropdown.py Add text property, rename events, update documentation, remove unused method
select_and_change_events.py New example demonstrating both selection and text change events
reactive.py New example showing reactive dropdown usage with state management
color_selection_with_filtering.py Update to use new on_select event instead of on_change
pyproject.toml Bump Python requirement to 3.10+
properties_table.py Refactor to use proper None comparisons and capture event properties
dropdown.dart Update Dart implementation to support new text property and events

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

FeodorFitsner and others added 3 commits August 24, 2025 11:44
Expanded the docstring for the border_radius property to specify accepted value types and default behavior when set to None.
Copy link

cloudflare-workers-and-pages bot commented Aug 24, 2025

Deploying flet-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 77bc52f
Status: ✅  Deploy successful!
Preview URL: https://39d8cc25.flet-docs.pages.dev
Branch Preview URL: https://v1-dropdown-fix.flet-docs.pages.dev

View logs

Introduces three new example scripts demonstrating CPU-bound task handling in Flet apps: cpu_bound_callback.py (thread-safe UI updates via callback), cpu_bound_queue.py (progress updates via asyncio.Queue), and cpu_bound_png_stream.py (streaming PNG frames from a producer thread to an async consumer). These examples illustrate best practices for integrating blocking operations with asyncio and Flet UI.
@FeodorFitsner FeodorFitsner merged commit 01d28c6 into main Aug 25, 2025
4 of 5 checks passed
@FeodorFitsner FeodorFitsner deleted the v1-dropdown-fix branch August 25, 2025 19:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants