Which button triggered the event in f7-dialog?

There is a dialog box and an array of buttons. Code example

f7.dialog.create({
        title   : 'Dialog WIndow',
        text    : 'text',
        buttons: [
             {
              text: 'OK'
              onClick: (dialog) => callback(dialog)
             },
             {
              text: 'Cancel'
              onClick: (dialog) => callback(dialog)
             },
        ]
    }).open();

How do I find out which button the click event occurred on (the button is ‘OK’ or ‘Cancel’), because in the callback function we will get the dialog object completely?

why not to pass additional argument to your callback function with the button pressed?

1 Like