Skip to content

Commit a1508c2

Browse files
author
Graham Butler
committed
Fix empty datalist injection bug
1 parent b4dd809 commit a1508c2

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@author.io/element-control",
3-
"version": "1.0.10",
3+
"version": "1.0.11",
44
"description": "author-control custom element (web component).",
55
"main": "dist/author-control.min.js",
66
"scripts": {

src/element.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ class AuthorFormControlElement extends AuthorBaseElement(HTMLElement) {
211211
return this.PRIVATE.initInput(node)
212212
}
213213

214-
let adjacentElement = collection[index + 1].addedNodes.item(0);
214+
let adjacentElement = collection[index + 1];
215215

216216
if (!adjacentElement || adjacentElement.nodeName !== 'DATALIST') {
217217
return this.PRIVATE.initInput(node)
@@ -254,7 +254,7 @@ class AuthorFormControlElement extends AuthorBaseElement(HTMLElement) {
254254
return
255255
}
256256

257-
this.PRIVATE.transformChild(node, index, array)
257+
this.PRIVATE.transformChild(node, index, array.map(mutation => mutation.addedNodes.item(0)))
258258
})
259259

260260
observer.disconnect()

0 commit comments

Comments
 (0)