MCPcopy Index your code
hub / github.com/ionic-team/ionic-framework / componentDidLoad

Method componentDidLoad

core/src/components/alert/alert.tsx:393–427  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

391 }
392
393 componentDidLoad() {
394 /**
395 * Only create gesture if:
396 * 1. A gesture does not already exist
397 * 2. App is running in iOS mode
398 * 3. A wrapper ref exists
399 */
400 if (!this.gesture && getIonMode(this) === 'ios' && this.wrapperEl) {
401 this.gesture = createButtonActiveGesture(this.wrapperEl, (refEl: HTMLElement) =>
402 refEl.classList.contains('alert-button')
403 );
404 this.gesture.enable(true);
405 }
406
407 this.setupButtonGroupResizeObserver();
408
409 /**
410 * If alert was rendered with isOpen="true"
411 * then we should open alert immediately.
412 */
413 if (this.isOpen === true) {
414 raf(() => this.present());
415 }
416
417 /**
418 * When binding values in frameworks such as Angular
419 * it is possible for the value to be set after the Web Component
420 * initializes but before the value watcher is set up in Stencil.
421 * As a result, the watcher callback may not be fired.
422 * We work around this by manually calling the watcher
423 * callback when the component has loaded and the watcher
424 * is configured.
425 */
426 this.triggerChanged();
427 }
428
429 /**
430 * Present the alert overlay after it has been created.

Callers

nothing calls this directly

Calls 7

presentMethod · 0.95
triggerChangedMethod · 0.95
getIonModeFunction · 0.90
rafFunction · 0.90
enableMethod · 0.65

Tested by

no test coverage detected