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

Allow arbitrary HTML for the options with custom elements #235

Open
jachin opened this issue Jun 12, 2023 · 2 comments · Fixed by #242
Open

Allow arbitrary HTML for the options with custom elements #235

jachin opened this issue Jun 12, 2023 · 2 comments · Fixed by #242
Labels
enhancement New feature or request

Comments

@jachin
Copy link

jachin commented Jun 12, 2023

Instead of using the <select> tag to setup the options have another API "path" that would make use of custom elements. This would allow just about any markup in the options (and the groups).

So things could look something like:

<much-select>
  <much-select-option option-value="fun" slot="much-select-option-fun">
   <h1>Hurray!</h1>
   <p>So much fun</p>
  </much-select-option>
  <much-select-option option-value="bear" slot="much-select-option-bear">
   <h2>Another one</h2>
   <img src="a/picture.jpg">
  </much-select-option>
</much-select>

I think things will work out better if each option has it's own unique slot.

@jachin jachin added the enhancement New feature or request label Jun 12, 2023
@jachin jachin linked a pull request Aug 22, 2023 that will close this issue
7 tasks
@jachin jachin reopened this Sep 12, 2023
@jachin
Copy link
Author

jachin commented Sep 26, 2023

It might be better to do this instead: #250

@jachin
Copy link
Author

jachin commented Mar 6, 2024

To finish this feature there are some remaining issues to work though:

In the selected value part of input field, what do we show in single select and in multi select? Do we just show the select value? Or a label?

When we're filtering down the options by typing, what text is the filter working off of? Does
(should) this feature even work if a <much-select>'s options are being rendered this way?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant