Polymer-1.0是否有纸质对话解雇事件?

时间:2015-10-07 00:38:28

标签: polymer-1.0

纸质对话是否有dismiss事件?我试过dialog-dismiss,但它不听ESC键盘按下。我尝试了iron-overlay-close,但是如果对话框中有另一个铁叠加层(例如铁下拉),则会出现此错误

1 个答案:

答案 0 :(得分:1)

dismiss没有特定的paper-dialog事件,因为它继承了铁叠加行为。但是,您可以创建一个自定义事件来触发对话框关闭:

// Fire a custom event 
this.fire('custom-dialog-dismiss');

// Listen to the event on an element OR add a listener
<my-element on-custom-dialog-dismiss="_handleDismiss"></my-element>
...or...
listeners: {
  'custom-dialog-dismiss': '_handleDismiss'
}

// Then handle the action
_handleDismiss: function(e) {
  this.$.myDialog.close();
}