Skip to content

Fix #472: recompose Picker collapsed value on selection change (Android)#473

Open
paulober wants to merge 1 commit into
skiptools:mainfrom
paulober:fix/472-picker-row-recompose
Open

Fix #472: recompose Picker collapsed value on selection change (Android)#473
paulober wants to merge 1 commit into
skiptools:mainfrom
paulober:fix/472-picker-row-recompose

Conversation

@paulober

@paulober paulober commented Jun 24, 2026

Copy link
Copy Markdown

A menu/automatic Picker inside a Form did not update its collapsed selected-value row when the bound value changed via the popup: the DropdownMenu checkmark moved, but the displayed row value stayed stale until the view was re-rendered for another reason (e.g. re-navigation).

The collapsed value is derived from selection.wrappedValue in processPickerContent, but a selection write through the Picker's own controls did not invalidate that Compose scope -- particularly with a bridged/@observable binding whose write happens outside Compose's snapshot system.

Add a selectionTrigger MutableState that every collapsed-value render path reads (inline, in the same Compose scope), and bump it from the menu and segmented selection actions right after writing selection.wrappedValue. That invalidates the render scope so the row re-reads the already-updated binding immediately.

Thank you for contributing to the Skip project! Please review the contribution guide at https://skip.dev/docs/contributing/ for advice and guidance on making high-quality PRs.

Use this space to describe your change and add any labels (bug, enhancement, documentation, etc.) to help categorize your contribution.

Skip Pull Request Checklist:

  • REQUIRED: I have signed the Contributor Agreement
  • REQUIRED: I have tested my change locally with swift test
  • OPTIONAL: I have tested my change on an iOS simulator or device
  • OPTIONAL: I have tested my change on an Android emulator or device
  • REQUIRED: I have checked whether this change requires a corresponding update in the Skip Fuse UI repository (link related PR if applicable)
  • OPTIONAL: I have added an example of any UI changes to the Showcase sample app

  • AI was used to generate or assist with generating this PR. Please specify below how you used AI to help you, and what steps you have taken to manually verify the changes.

AI was used to quickly get into the project like analyzing how the components work, and to compose a commit message + PR description.


…ge (Android)

A menu/automatic Picker inside a Form did not update its collapsed
selected-value row when the bound value changed via the popup: the
DropdownMenu checkmark moved, but the displayed row value stayed stale
until the view was re-rendered for another reason (e.g. re-navigation).

The collapsed value is derived from selection.wrappedValue in
processPickerContent, but a selection write through the Picker's own
controls did not invalidate that Compose scope -- particularly with a
bridged/@observable binding whose write happens outside Compose's
snapshot system.

Add a selectionTrigger MutableState that every collapsed-value render
path reads (inline, in the same Compose scope), and bump it from the
menu and segmented selection actions right after writing
selection.wrappedValue. That invalidates the render scope so the row
re-reads the already-updated binding immediately.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@cla-bot

cla-bot Bot commented Jun 24, 2026

Copy link
Copy Markdown

Thank you for your pull request and welcome to the Skip community. We require contributors to sign our contributor license agreement (CLA), and we don't seem to have the user(s) @paulober on file. In order for us to review and merge your code, for each noted user please add your GitHub username to Skip's .clabot file

@paulober

Copy link
Copy Markdown
Author

@cla-bot recheck

@paulober

Copy link
Copy Markdown
Author

Thank you for your pull request and welcome to the Skip community. We require contributors to sign our contributor license agreement (CLA), and we don't seem to have the user(s) @paulober on file. In order for us to review and merge your code, for each noted user please add your GitHub username to Skip's .clabot file

@cla-bot recheck

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.

1 participant