-
Notifications
You must be signed in to change notification settings - Fork 13
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
Question: Value of having a optionValuePath prop #49
Comments
@SCasarotto Can you have a look into #43 |
I see the use case of |
Ah totally. I remember reading this a couple weeks ago when you posted it. Render props as you describe would solve this as well. Is that something you are currently working on? Any idea on timeline? Want help? |
I'll spike into this on the weekend. Will keep posted here |
Appreciate all your hard work! |
@SCasarotto Couldn't find time for this last week. Do you've anytime to help to add |
I think to move toward the render props is the right idea (#43). Are you looking for assistance there? |
This is something I have been thinking about for a while and didn't know if this was something I would build into my wrapper or if it could be beneficial in the library. Currently, when you have an array of objects you can use
optionLabelPath
to determine what value to display in the selector and search. Would there be value in having anoptionValuePath
so that when the component is trying to compare selected values it simply string compares instead of handle any object comparison? Obviously, this would require theoptionValuePath
to always be unique for each option. I haven't looked deeply into how much this would change things in the library but thought it was interesting.Some Context:
Often, I have an array of objects where the users select an object but we only save a reference key in our database and not the whole object. In order for the component to have the correct initial state (know which option(s) have been selected) I have to recreate the object and pass it as the value instead of simply the reference id.
The text was updated successfully, but these errors were encountered: