nakarte

Source code of https://map.sikmir.ru (fork)
git clone git://git.sikmir.ru/nakarte
Log | Files | Refs | LICENSE

commit 6658584154fe7b75f4a7059ba63c9155a11753da
parent 84f6e62941318f19e4ee470732ef88fb5d3b1d0f
Author: Sergey Orlov <wladimirych@gmail.com>
Date:   Thu,  2 Jul 2020 20:10:58 +0200

layers hotkeys: ignore events from input with type="search"

Diffstat:
Msrc/lib/leaflet.control.layers.hotkeys/index.js | 7+++++--
1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/lib/leaflet.control.layers.hotkeys/index.js b/src/lib/leaflet.control.layers.hotkeys/index.js @@ -74,8 +74,11 @@ function enableHotKeys(control) { const pressedKey = this._keyDown; this._keyDown = null; const targetTag = e.target.tagName.toLowerCase(); - if ((targetTag === 'input' && e.target.type === 'text') || targetTag === 'textarea' || - pressedKey !== e.keyCode) { + if ( + (targetTag === 'input' && ['text', 'search'].includes(e.target.type)) || + targetTag === 'textarea' || + pressedKey !== e.keyCode + ) { return; } const key = String.fromCharCode(e.keyCode);