Fix unintentional shortcut activations when typing text
Test Plan: Pressing 'd' key in search box and in custom profile editor no longer activates route drawing.
This commit is contained in:
parent
0b88114ae1
commit
2022069066
1 changed files with 8 additions and 1 deletions
|
|
@ -333,8 +333,15 @@ BR.Routing = L.Routing.extend({
|
|||
return segments;
|
||||
},
|
||||
|
||||
// add 'esc' to disable drawing
|
||||
_keyupListener: function(e) {
|
||||
// Suppress shortcut handling when a text input field is focussed
|
||||
if (
|
||||
document.activeElement.type == 'text' ||
|
||||
document.activeElement.type == 'textarea'
|
||||
) {
|
||||
return;
|
||||
}
|
||||
// add 'esc' to disable drawing
|
||||
if (e.keyCode === 27) {
|
||||
this._draw.disable();
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue