@@ -195,18 +195,18 @@ class AuthorFormControlElement extends AuthorBaseElement(HTMLElement) {
195195 this . PRIVATE . initSelectSurrogate ( select , document . createElement ( 'author-select' ) )
196196 } ,
197197
198- transformChild : node => {
198+ transformChild : ( node , collection ) => {
199199 switch ( node . nodeName ) {
200200 case 'LABEL' :
201201 return this . PRIVATE . initLabel ( node )
202202
203203 case 'INPUT' :
204204 // Check if there is an additional element adjacent to the input
205- if ( array [ index + 1 ] === void 0 ) {
205+ if ( collection [ index + 1 ] === void 0 ) {
206206 return this . PRIVATE . initInput ( node )
207207 }
208208
209- let adjacentElement = array [ index + 1 ] . addedNodes . item ( 0 ) ;
209+ let adjacentElement = collection [ index + 1 ] . addedNodes . item ( 0 ) ;
210210
211211 if ( ! adjacentElement || adjacentElement . nodeName !== 'DATALIST' ) {
212212 return this . PRIVATE . initInput ( node )
@@ -249,15 +249,15 @@ class AuthorFormControlElement extends AuthorBaseElement(HTMLElement) {
249249 return
250250 }
251251
252- this . PRIVATE . transformChild ( node )
252+ this . PRIVATE . transformChild ( node , 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 => this . PRIVATE . transformChild ( child ) )
260+ rendered : ( ) => Array . from ( this . children ) . forEach ( ( child , index , array ) => this . PRIVATE . transformChild ( child , array ) )
261261 } )
262262 }
263263
0 commit comments