sveltejs / svelte

Cybernetically enhanced web apps
https://svelte.dev
MIT License
78.05k stars 4.07k forks source link

Support `bind:value` for `selectmenu` #7823

Open tbdrz opened 1 year ago

tbdrz commented 1 year ago

Describe the problem

When trying to use bind:value for the HTMLElement selectmenu (link), i get an invalid-binding error message: 'value' is not a valid binding on elements.

Describe the proposed solution

Add support for the selectmenu element

Alternatives considered

<script>
  let selected;
</script>

<selectmenu on:change={(e) => (selected = e.target.value)}>
  <option>Option 1</option>
  <option>Option 2</option>
  <option>Option 3</option>
</selectmenu>

Importance

nice to have

jrmoynihan commented 1 year ago

Might be a while for this one. I suspect the maintainers will wait until it lands in the HTML spec ("use the platform" is the mantra around Svelte).

So far, not much movement on implementation outside of the experimental flag in Chromium: https://chromestatus.com/feature/5737365999976448