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

Method callButtonHandler

core/src/components/toast/toast.tsx:545–560  ·  view source on GitHub ↗
(button: ToastButton | undefined)

Source from the content-addressed store, hash-verified

543 }
544
545 private async callButtonHandler(button: ToastButton | undefined) {
546 if (button?.handler) {
547 // a handler has been provided, execute it
548 // pass the handler the values from the inputs
549 try {
550 const rtn = await safeCall(button.handler);
551 if (rtn === false) {
552 // if the return value of the handler is false then do not dismiss
553 return false;
554 }
555 } catch (e) {
556 printIonError('[ion-toast] - Exception in callButtonHandler:', e);
557 }
558 }
559 return true;
560 }
561
562 private dispatchCancelHandler = (ev: CustomEvent) => {
563 const role = ev.detail.role;

Callers 2

buttonClickMethod · 0.95
ToastClass · 0.95

Calls 2

safeCallFunction · 0.90
printIonErrorFunction · 0.90

Tested by

no test coverage detected