-
-
Notifications
You must be signed in to change notification settings - Fork 46.9k
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
New Select component props: optionSelectedLabelProp, optionSelectableLabelProp #28015
Comments
I would love any feedback on this feature request. I already have a pull request for this feature, but can gladly alter it to accommodate requested changes. You can view my pull request here and see it already passes all deployment checks: react-component/select#573 Looking forward to hearing back! Thanks! |
@svpease I'm not a core contributor, but looks good to me 😄 |
Thank you Joe! Do you have any idea what kind of timeframe it takes to get the attention of a core contributor? |
@zombieJ I just realized I could tag you in this thread -- any chance I could get a review for this pull request? I invested a solid amount of time encapsulating all logic for how options are created/updated for rc-select that I think will be great for the codebase. Some time has passed since my PR, but I don't mind merging in changes between then and now if it has a shot of getting accepted. Thanks! |
What problem does this feature solve?
The "optionLabelProp" is useful for choosing a label for a selected option (that differs from how it appears in the dropdown), but it doesn't work for AutoComplete, which always uses "value" instead to populate its search field.
So that a new feature to change this behavior is backwards-compatible, I propose adding two new explicit props that will work whether or not a search field is being used to show its selected option.
The two new props: "optionSelectedLabelProp" (for how the label appears when an option is selected) and "optionSelectableLabelProp" (for how an option's label appears in the dropdown).
The two new props will also make more sense and be more straight-forward as people migrate away from using Option and OptionGroup JSX to specifying their options via the "options" prop.
What does the proposed API look like?
The text was updated successfully, but these errors were encountered: