mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-02-13 23:14:32 -05:00
Only trigger clear/cancel buttons on certain keys
It’s annoying having these buttons triggered by the tab or command keys.
This commit is contained in:
@@ -74,8 +74,11 @@
|
||||
.addClass('js-cancel')
|
||||
.attr('tabindex', '0')
|
||||
.on('click keydown', event => {
|
||||
event.preventDefault();
|
||||
fn();
|
||||
// space, enter or no keyCode (must be mouse input)
|
||||
if ([13, 32, undefined].indexOf(event.keyCode) > -1) {
|
||||
event.preventDefault();
|
||||
fn();
|
||||
}
|
||||
});
|
||||
|
||||
this.selectActionButtons = function () {
|
||||
|
||||
Reference in New Issue
Block a user