@@ -359,28 +359,30 @@ class UI5Element extends HTMLElement {
359
359
this . _monitoredChildProps . set ( slotName , { observedProps, notObservedProps } ) ;
360
360
}
361
361
362
- child . addEventListener ( "_propertyChange" , this . _onChildPropertyUpdated ) ;
362
+ child . addEventListener ( "_propertyChange" , this . _invalidateParentOfPropertyUpdate ) ;
363
363
}
364
364
365
365
_detachChildPropertyUpdated ( child ) {
366
- child . removeEventListener ( "_propertyChange" , this . _onChildPropertyUpdated ) ;
366
+ child . removeEventListener ( "_propertyChange" , this . _invalidateParentOfPropertyUpdate ) ;
367
367
}
368
368
369
- _onChildPropertyUpdated ( prop ) {
370
- if ( ! this . parentNode ) {
369
+ _invalidateParentOfPropertyUpdate ( prop ) {
370
+ // The web component to be invalidated
371
+ const parentNode = this . parentNode ;
372
+ if ( ! parentNode ) {
371
373
return ;
372
374
}
373
375
374
- const slotName = this . constructor . _getSlotName ( this ) ;
375
- const propsMetadata = this . parentNode . _monitoredChildProps . get ( slotName ) ;
376
+ const slotName = parentNode . constructor . _getSlotName ( this ) ;
377
+ const propsMetadata = parentNode . _monitoredChildProps . get ( slotName ) ;
376
378
377
379
if ( ! propsMetadata ) {
378
380
return ;
379
381
}
380
382
const { observedProps, notObservedProps } = propsMetadata ;
381
383
382
384
if ( observedProps . includes ( prop . detail . name ) && ! notObservedProps . includes ( prop . detail . name ) ) {
383
- this . parentNode . _invalidate ( "_parent_" , this ) ;
385
+ parentNode . _invalidate ( "_parent_" , this ) ;
384
386
}
385
387
}
386
388
0 commit comments