mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-18 05:29:38 -04: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')
|
.addClass('js-cancel')
|
||||||
.attr('tabindex', '0')
|
.attr('tabindex', '0')
|
||||||
.on('click keydown', event => {
|
.on('click keydown', event => {
|
||||||
event.preventDefault();
|
// space, enter or no keyCode (must be mouse input)
|
||||||
fn();
|
if ([13, 32, undefined].indexOf(event.keyCode) > -1) {
|
||||||
|
event.preventDefault();
|
||||||
|
fn();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
this.selectActionButtons = function () {
|
this.selectActionButtons = function () {
|
||||||
|
|||||||
Reference in New Issue
Block a user