Skip to content
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

TagInput - preset v-model OptionsPropItem values aren't displayed properly #1148

Closed
joeyberkovitz opened this issue Dec 16, 2024 · 3 comments
Labels
wontfix This will not be worked on

Comments

@joeyberkovitz
Copy link
Contributor

Overview of the problem

Oruga version: 0.9.2

Description

If using a taginput with OptionsPropItem entries, the values are handled properly when added via autocomplete. If preset via v-model upon the taginput creation with an OptionsPropItem object provided to the v-model, it tries to display the entire object instead of just the OptionsPropItem label

@mlmoravek
Copy link
Member

Hey, the value of the v-model is only the value declared on the value attribute of an OptionsPropItem object, not the whole object. So the OptionsPropItem is a wrapper of the real value of an option and the associated label (and some other attributes if needed).

A more detailed description of the options prop and its declaration types and behaviour will surely follow in the docs!

@mlmoravek mlmoravek added the wontfix This will not be worked on label Dec 17, 2024
@mlmoravek
Copy link
Member

See #1126

@joeyberkovitz
Copy link
Contributor Author

Yeah, I think I was running into an issue where if an object is initially passed into a taginput with no options populated (since they autocomplete), it just displays the entire object as JSON.

If you alternatively populate the options via autocomplete, then select an option, the value displayed is the label from the selected option's OptionsPropItem. So it might be convenient for the TagInput model to either be, or accept an OptionsPropItem, otherwise it's just a bit odd - although it does kind of make sense - that the model values all must exist in the provided options list to be displayed properly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants