Skip to content

fix: preserve searchable dropdown selections on sync - #2404

Open
pcbeingused333 wants to merge 1 commit into
FlowFuse:mainfrom
pcbeingused333:fix/dropdown-multiple-sync-c5918
Open

pcbeingused333 wants to merge 1 commit into
FlowFuse:mainfrom
pcbeingused333:fix/dropdown-multiple-sync-c5918

Conversation

@pcbeingused333

Copy link
Copy Markdown
Contributor

When a searchable dropdown allows multiple selections, changing the selection in one browser can clear it in another. The widget sync handler looks for one option whose value equals the entire payload array, so it cannot resolve the individual values.

Resolve array payloads through the dropdown's existing selection helper when multiple selection is active. This restores matching options on the receiving client and lets an empty array clear the selection.

A standalone Node.js check (not included in this PR, since the repo's unit tests target plain JS modules rather than .vue components) called the component's sync handler directly. It covers multiple values, clearing, and dynamically enabling multiple selection. The controls cover single values, array-valued options in single-selection mode, and dropdowns without search. Three cases fail on main and all six pass with the fix. ESLint passes for the changed component.

This change was prepared with AI assistance.

This branch has not been deployed

No deployments
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