-
Notifications
You must be signed in to change notification settings - Fork 478
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
feat(SelectMenu): add selected to label
/ leading
/ trailing
slots props
#1349
Merged
Merged
Changes from 6 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
3303f08
feat(SelectMenu): add selected value to label slot data
CernyMatej bf3c22f
fix(SelectMenu): handle non array model value error when multiple proβ¦
CernyMatej 27bbcd4
feat(SelectMenu): add real selected value to label slot data
CernyMatej 621bd63
fix(SelectMenu): show real selected count in label when multiple propβ¦
CernyMatej fe4e694
Merge branch 'dev' into pr/1349
benjamincanac 5046686
Merge branch 'dev' into dev
benjamincanac 04effff
add `selected` to leading and trailing slots
benjamincanac File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure to understand why you added this computed, could you provide a real-life example where you need this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure!
When you change the selected value using the
value-attribute
prop, there is currently no way (at least as far as I'm aware) to access the remaining attributes of the selected object.Let's say we have an array of categories with translated names:
This is how I would use it:
This applies to the
#leading
and#trailing
slots as well. Currently, you wouldn't be able to access any icon attributes of the object in those slots, if you changed thevalue-attribute
, would you? So it might be worth adding this to those slots as well.Or am I missing something?