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

Method openAlert

core/src/components/select/select.tsx:741–787  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

739 }
740
741 private async openAlert() {
742 const interfaceOptions = this.interfaceOptions;
743 const inputType = this.multiple ? 'checkbox' : 'radio';
744 const mode = getIonMode(this);
745
746 const alertOpts: AlertOptions = {
747 mode,
748 ...interfaceOptions,
749
750 header: interfaceOptions.header ? interfaceOptions.header : this.labelText,
751 inputs: this.createAlertInputs(this.childOpts, inputType, this.value),
752 buttons: [
753 {
754 text: this.cancelText,
755 role: 'cancel',
756 handler: () => {
757 this.ionCancel.emit();
758 },
759 },
760 {
761 text: this.okText,
762 handler: (selectedValues: any) => {
763 this.setValue(selectedValues);
764 },
765 },
766 ],
767 cssClass: [
768 'select-alert',
769 interfaceOptions.cssClass,
770 this.multiple ? 'multiple-select-alert' : 'single-select-alert',
771 ],
772 };
773
774 /**
775 * Workaround for Stencil to autodefine
776 * ion-alert when
777 * using Custom Elements build.
778 */
779 // eslint-disable-next-line
780 if (false) {
781 // eslint-disable-next-line
782 // @ts-ignore
783 document.createElement('ion-alert');
784 }
785
786 return alertController.create(alertOpts);
787 }
788
789 private openModal() {
790 const { multiple, value, interfaceOptions } = this;

Callers 1

createOverlayMethod · 0.95

Calls 4

createAlertInputsMethod · 0.95
setValueMethod · 0.95
getIonModeFunction · 0.90
createMethod · 0.65

Tested by

no test coverage detected