File tree Expand file tree Collapse file tree
core/src/components/checkbox Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -154,11 +154,11 @@ export class Checkbox implements ComponentInterface {
154154 if ( Build . isBrowser && typeof MutationObserver !== 'undefined' ) {
155155 this . validationObserver = new MutationObserver ( ( mutations ) => {
156156 // Watch for label content changes
157- if ( mutations . some ( ( mutation ) => mutation . type === 'characterData' ) ) {
157+ if ( mutations . some ( ( mutation ) => mutation . type === 'characterData' || mutation . type === 'childList' ) ) {
158158 this . hasLabelContent = this . el . textContent !== '' ;
159159 }
160160 // Watch for class changes to update validation state.
161- if ( mutations . some ( ( mutation ) => mutation . type === 'attributes' ) ) {
161+ if ( mutations . some ( ( mutation ) => mutation . type === 'attributes' && mutation . target === el ) ) {
162162 const newIsInvalid = checkInvalidState ( el ) ;
163163 if ( this . isInvalid !== newIsInvalid ) {
164164 this . isInvalid = newIsInvalid ;
@@ -191,6 +191,7 @@ export class Checkbox implements ComponentInterface {
191191 attributes : true ,
192192 attributeFilter : [ 'class' ] ,
193193 characterData : true ,
194+ childList : true ,
194195 subtree : true ,
195196 } ) ;
196197 }
You can’t perform that action at this time.
0 commit comments