(button: ToastButton | undefined)
| 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; |
no test coverage detected