纸对话,铁覆盖 - 取消未被解雇

时间:2016-04-20 08:33:41

标签: javascript html polymer-1.0

我有一个paper-dialog有两个paper-button,一个用于确认,另一个用于解雇,如下所示:

<!-- Change password dialog -->
<paper-dialog id="changePasswordDialog"
    on-iron-overlay-closed="_onDialogConfirm"
    on-iron-overlay-canceled="_onDialogCancel"           
    modal with-backdrop
    entry-animation="scale-up-animation"
    exit-animation="fade-out-animation">
    <h2>Enter your preferences</h2>
    <paper-dialog-scrollable>
       <!-- my content -->
    </paper-dialog-scrollable>
    <div class="buttons">
        <paper-button dialog-dismiss>Cancel</paper-button>
        <paper-button dialog-confirm>Change</paper-button>
    </div>
</paper-dialog>

我还注册,关闭和取消了两个事件如下:

_onDialogCancel: function(event){
    console.log(event);
},

_onDialogConfirm: function (closingReason) {
    console.log(closingReason);
},

如果我按下paper-button &#34;对话框 - 确认&#34; ,则会触发事件_onDialogConfirmclosingReason.canceled = false。如果我按下paper-button &#34;对话框关闭&#34; ,则不会触发事件_onDialogCancel,并使用{{1}触发事件_onDialogConfirm }}

问题

为什么只有closingReason.canceled = true被解雇?我需要在event on-iron-overlay-closed期间做出决定,并选择是否要保持对话框打开,但事件永远不会被触发。

0 个答案:

没有答案