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

Suggestion: Custom render components for labels #38

Open
RuraDev opened this issue Feb 19, 2018 · 1 comment
Open

Suggestion: Custom render components for labels #38

RuraDev opened this issue Feb 19, 2018 · 1 comment

Comments

@RuraDev
Copy link

RuraDev commented Feb 19, 2018

Id suggest to add an option to pass custom render components for labels as props.
For example, if I want to display some info button or custom styling for different items of different types. I'd like to control the labels.
What do you say, guys?

@jakezatecky
Copy link
Owner

While that is a mostly reasonable request, we are using the HTML <select> tag for much of the functionality in this component. The <option> tags are used to display all of the options, and the permitted content of these tags are only text. Similarly, the label property of an <optgroup> naturally will only allow text.

Therefore, in order to have custom components for the labels, we would have to rewrite parts of the library to not use the native HTML <select>, but use some custom machination that emulates its behavior and fires all appropriate events. Then arbitrary components would be allowed for the labels.

Unless someone is willing to submit a PR that overhauls the whole <select>, <optgroup>, and <option> interaction with something custom, I will likely not add this enhancement.

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

No branches or pull requests

2 participants