hyperhype/hyperscript

Input datalist not working

8483 opened this issue · 1 comments

8483 commented

The following code:

h('input', { list: "list-id"}),
h('datalist', { id: "list-id" }, [
    h('option', ["Option 1"]),
])`

results in:

<input>
<datalist id="list-id">
    <option>Option 1</option>
</datalist>

The input element lacks the list property i.e. It should look like <input list="list-id">

What am I doing wrong?

8483 commented

I managed to solve it with:

h('input', { attributes: { 'list': "list-id" } })
h('datalist', { id: "list-id" }, [
    h('option', ["Option 1"]),
])`