TypeError: undefined is not an object (evaluating 'i.setAttributeNode')
See original GitHub issueI tried to use datalist-polyfill, but I am getting this error when clicking in a field with a datalist, and nothing is displayed when I type some characters:
TypeError: undefined is not an object (evaluating 'i.setAttributeNode')
The markup is dynamically created with simple DOM methods. It works fine in non-Safari browsers. I tested with WebKit-based browser Epiphany.
<p><datalist id="nml_itemized_categories_datalist"><option value="..."></option>[many other options here]</datalist><input id="nml_itemized_categories_add_input" size="30" class="form-control" list="nml_itemized_categories_datalist"></p>
It looks like the polyfill is supposed to create a select inside dataset (from what I can see in the demo, which works), but that select element is never created, and I don’t see any error message about it.
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (3 by maintainers)
Actually, I found that I could avoid this bug by specifying the input type explicitly (“text” is the default type). A simple fix would be to accept a non-existent type attribute as “text”.
@damien-git, totally agreed ! I’ll mention it within the readme.