Skip to content

Fix TDropDown.update_value() missing UI refresh call#242

Merged
clstaudt merged 2 commits intostreamlinefrom
copilot/sub-pr-239-another-one
Mar 12, 2026
Merged

Fix TDropDown.update_value() missing UI refresh call#242
clstaudt merged 2 commits intostreamlinefrom
copilot/sub-pr-239-another-one

Conversation

Copy link
Contributor

Copilot AI commented Mar 10, 2026

TDropDown.update_value() did not call self.update(), so programmatic value changes (e.g. in PreferencesScreen.refresh_preferences_items()) never triggered a UI refresh — unlike update_dropdown_items() and update_error_txt() which both do.

Changes

  • tuttle/app/core/views.py: Added self.update() to update_value(), wrapped in try/except RuntimeError to handle pre-mount calls gracefully (Flet 0.81 raises RuntimeError rather than returning None from .page when the control isn't yet attached)
def update_value(self, new_value: str):
    self.drop_down.value = new_value
    self.drop_down.error_text = None
    try:
        self.update()
    except RuntimeError:
        pass  # control not yet mounted

The guard is necessary because an existing test (test_update_value_before_build) covers the pre-mount path, and unconditional self.update() raises on unmounted controls in this version of Flet.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

…n mounted

Co-authored-by: clstaudt <875194+clstaudt@users.noreply.github.com>
Copilot AI changed the title [WIP] WIP Address UI/UX changes in response to review feedback Fix TDropDown.update_value() missing UI refresh call Mar 10, 2026
@clstaudt clstaudt marked this pull request as ready for review March 12, 2026 21:24
@clstaudt clstaudt merged commit 8dbdc92 into streamline Mar 12, 2026
2 checks passed
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