commit | 2c75c6b2cbd71b78e3363e8926a1f15d08d281cd | [log] [tgz] |
---|---|---|
author | Milutin Kristofic <milutin@google.com> | Wed Apr 07 12:51:24 2021 +0200 |
committer | Milutin Kristofic <milutin@google.com> | Wed Apr 07 12:51:24 2021 +0200 |
tree | c2db9972793392b18a6271b58965cef6ed080a98 | |
parent | 5b17aa07bdbe0c08a0c7393dff43d7dcda985eb9 [diff] |
Pressing enter on focused button supress keyboard shortcuts This is follow-up fix for Change-Id: Iaaa346f917f984b94b9caebb908b34be5c041518 Now pressing enter on focus comments chips will open comments tab. Change-Id: I6d28ebd022041a617be645fcd7f89ecb68d9cc54
diff --git a/polygerrit-ui/app/mixins/keyboard-shortcut-mixin/keyboard-shortcut-mixin.ts b/polygerrit-ui/app/mixins/keyboard-shortcut-mixin/keyboard-shortcut-mixin.ts index 85931b4..746d101 100644 --- a/polygerrit-ui/app/mixins/keyboard-shortcut-mixin/keyboard-shortcut-mixin.ts +++ b/polygerrit-ui/app/mixins/keyboard-shortcut-mixin/keyboard-shortcut-mixin.ts
@@ -837,8 +837,9 @@ // mark-reviewed and then press ] to go to the next file'. (tagName === 'INPUT' && type !== 'checkbox') || tagName === 'TEXTAREA' || - // Suppress shortcuts if the key is 'enter' and target is an anchor. - (e.keyCode === 13 && tagName === 'A') + // Suppress shortcuts if the key is 'enter' + // and target is an anchor or button. + (e.keyCode === 13 && (tagName === 'A' || tagName === 'BUTTON')) ) { return true; }