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

Method buttonClick

core/src/components/toast/toast.tsx:533–543  ·  view source on GitHub ↗
(button: ToastButton)

Source from the content-addressed store, hash-verified

531 }
532
533 private async buttonClick(button: ToastButton) {
534 const role = button.role;
535 if (isCancel(role)) {
536 return this.dismiss(undefined, role);
537 }
538 const shouldDismiss = await this.callButtonHandler(button);
539 if (shouldDismiss) {
540 return this.dismiss(undefined, role);
541 }
542 return Promise.resolve();
543 }
544
545 private async callButtonHandler(button: ToastButton | undefined) {
546 if (button?.handler) {

Callers 1

renderButtonsMethod · 0.95

Calls 3

dismissMethod · 0.95
callButtonHandlerMethod · 0.95
isCancelFunction · 0.90

Tested by

no test coverage detected