? should close the dialog if pressed again when its open

Change-Id: I5a3d74b8d31eb96a29bdfc0dfe7c339fab0d36d4
This commit is contained in:
Tao Zhou
2020-03-19 10:30:35 +01:00
parent d9aa6b035f
commit 67286a8c18

View File

@@ -497,6 +497,12 @@ class GrAppElement extends mixinBehaviors( [
}
_showKeyboardShortcuts(e) {
// same shortcut should close the dialog if pressed again
// when dialog is open
if (this.$.keyboardShortcuts.opened) {
this.$.keyboardShortcuts.close();
return;
}
if (this.shouldSuppressKeyboardShortcut(e)) { return; }
this.$.keyboardShortcuts.open();
}