Do not close modal if escape is pressed on select
The modal no longer fades out when pressing escape if a select is open. After this, the select input is unfocused, so the second press on escape will still close the modal. Fixes bug #1265869 Change-Id: I49fa4431152fa3101bb6fafa6e07c8f908396ba8
This commit is contained in:
parent
fb0d5e4aaa
commit
37e4403ee8
|
@ -140,6 +140,14 @@ horizon.addInitFunction(function() {
|
|||
topVal = $this.css('top');
|
||||
$this.css('top', scrollShift + parseInt(topVal, 10));
|
||||
}
|
||||
// avoid closing the modal when escape is pressed on a select input
|
||||
$("select", evt.target).keyup(function (e) {
|
||||
if (e.keyCode === 27) {
|
||||
// remove the focus on the select, so double escape close the modal
|
||||
e.target.blur();
|
||||
e.stopPropagation();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// Focus the first usable form field in the modal for accessibility.
|
||||
|
|
Loading…
Reference in New Issue