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:
Henrik Fehlauer 2019-05-30 23:52:59 +02:00
parent 0b88114ae1
commit 2022069066

View file

@ -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 {