code: function onButtonEvent(e) {
        var target = e.target;
        var confirmButton = domCache.confirmButton,
            cancelButton = domCache.cancelButton;
        var targetedConfirm = confirmButton && (confirmButton === target || confirmButton.contains(target));
        var targetedCancel = cancelButton && (cancelButton === target || cancelButton.contains(target));
  
        switch (e.type) {
          case 'click':
            // Clicked 'confirm'
            if (targetedConfirm && constructor.isVisible()) {
              _this.disableButtons();
  
              if (innerParams.input) {
                var inputValue = getInputValue();
  
                if (innerParams.inputValidator) {
                  _this.disableInput();
  
                  var validationPromise = Promise.resolve().then(function () {
                    return innerParams.inputValidator(inputValue, innerParams.extraParams);
                  });
  
                  if (innerParams.expectRejections) {
                    validationPromise.then(function () {
                      _this.enableButtons();
  
                      _this.enableInput();
  
                      confirm(inputValue);
                    }, function (validationMessage) {
                      _this.enableButtons();
  
                      _this.enableInput();
  
                      if (validationMessage) {
                        _this.showValidationMessage(validationMessage);
                      }
                    });
                  } else {
                    validationPromise.then(function (validationMessage) {
                      _this.enableButtons();
  
                      _this.enableInput();
  
                      if (validationMessage) {
                        _this.showValidationMessage(validationMessage);
                      } else {
                        confirm(inputValue);
                      }
                    }, function (error$$1) {
                      return errorWith(error$$1);
                    });
                  }
                } else {
                  confirm(inputValue);
                }
              } else {
                confirm(true);
              } // Clicked 'cancel'
  
            } else if (targetedCancel && constructor.isVisible()) {
              _this.disableButtons();
  
              dismissWith(constructor.DismissReason.cancel);
            }
  
            break;
  
          default:
        }
      }
docs: Mouse interactions