Input datalist not working in hyperscript

189 Views Asked by At

I am using the following library: https://github.com/hyperhype/hyperscript

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?

1

There are 1 best solutions below

2
On

I managed to solve it with:

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