Skip to content

Commit a750dad

Browse files
author
Graham Butler
committed
fix transformChild bug
1 parent 6d26e38 commit a750dad

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
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.7",
3+
"version": "1.0.8",
44
"description": "author-control custom element (web component).",
55
"main": "dist/author-control.min.js",
66
"scripts": {

src/element.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ class AuthorFormControlElement extends AuthorBaseElement(HTMLElement) {
195195
this.PRIVATE.initSelectSurrogate(select, document.createElement('author-select'))
196196
},
197197

198-
transformChild: (node, collection) => {
198+
transformChild: (node, index, collection) => {
199199
switch (node.nodeName) {
200200
case 'LABEL':
201201
return this.PRIVATE.initLabel(node)
@@ -249,15 +249,15 @@ class AuthorFormControlElement extends AuthorBaseElement(HTMLElement) {
249249
return
250250
}
251251

252-
this.PRIVATE.transformChild(node, array)
252+
this.PRIVATE.transformChild(node, index, array)
253253
})
254254

255255
observer.disconnect()
256256
})
257257

258258
this.UTIL.registerListeners(this, {
259259
connected: () => this.PRIVATE.guid = this.UTIL.generateGuid('control_'),
260-
rendered: () => Array.from(this.children).forEach((child, index, array) => this.PRIVATE.transformChild(child, array))
260+
rendered: () => Array.from(this.children).forEach((child, index, array) => this.PRIVATE.transformChild(child, index, array))
261261
})
262262
}
263263

0 commit comments

Comments
 (0)