Merge pull request #198 from rkflx/rkflx/inhibit-shortcuts
Fix unintentional shortcut activations when typing text
This commit is contained in:
commit
34b253fb94
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