MCPcopy Create free account
hub / github.com/ionic-team/ionic-framework / connectedCallback

Method connectedCallback

core/src/components/input/input.tsx:407–450  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

405 }
406
407 connectedCallback() {
408 const { el } = this;
409
410 this.slotMutationController = createSlotMutationController(el, ['label', 'start', 'end'], () => {
411 this.setSlottedLabelId();
412 forceUpdate(this);
413 });
414
415 this.setSlottedLabelId();
416 this.notchController = createNotchController(
417 el,
418 () => this.notchSpacerEl,
419 () => this.labelSlot
420 );
421
422 // Watch for class changes to update validation state
423 if (Build.isBrowser && typeof MutationObserver !== 'undefined') {
424 this.validationObserver = new MutationObserver(() => {
425 const newIsInvalid = checkInvalidState(el);
426 if (this.isInvalid !== newIsInvalid) {
427 this.isInvalid = newIsInvalid;
428 // Force a re-render to update aria-describedby immediately
429 forceUpdate(this);
430 }
431 });
432
433 this.validationObserver.observe(el, {
434 attributes: true,
435 attributeFilter: ['class'],
436 });
437 }
438
439 // Always set initial state
440 this.isInvalid = checkInvalidState(el);
441
442 this.debounceChanged();
443 if (Build.isBrowser) {
444 document.dispatchEvent(
445 new CustomEvent('ionInputDidLoad', {
446 detail: this.el,
447 })
448 );
449 }
450 }
451
452 componentDidLoad() {
453 this.originalIonInput = this.ionInput;

Callers

nothing calls this directly

Calls 5

setSlottedLabelIdMethod · 0.95
debounceChangedMethod · 0.95
createNotchControllerFunction · 0.90
checkInvalidStateFunction · 0.90

Tested by

no test coverage detected