Skip to content

Composition API: A new options is not shown as selected when it is added and selected at the same time #446

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

Open
odzhychko opened this issue Apr 16, 2025 · 0 comments · May be fixed by #447

Comments

@odzhychko
Copy link

Version

  • Vue version: 3

Description

The bug is specific to usage with the Composition API.
Given options and value passed as a Ref.

When a new option is added to options and also to value to make it selected,
the newly added option is not displayed as selected.

It seems, that the internal state for selected options to be displayed relies on the internal state of available options. But with composable, the internal state of available options is updated before the internal state of selected options.

Demo

Screencast.From.2025-04-17.00-34-18.mp4

https://jsfiddle.net/Lnso82b5/7/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment