summaryrefslogtreecommitdiffstats
path: root/browser/src/map/handler/Map.Keyboard.js
diff options
context:
space:
mode:
authorGökay Şatır <gokaysatir@gmail.com>2024-03-26 15:58:22 +0300
committerGökay ŞATIR <gokaysatir@gmail.com>2024-03-28 12:44:53 +0300
commitb6a1df0c9d20d1b5e7d3aaa70aabf5242751dd88 (patch)
treef486022f3d9d5e530d161c21ac104f6f780d161b /browser/src/map/handler/Map.Keyboard.js
parentFix error on hide tooltip (diff)
downloadonline-b6a1df0c9d20d1b5e7d3aaa70aabf5242751dd88.tar.gz
online-b6a1df0c9d20d1b5e7d3aaa70aabf5242751dd88.zip
Show cursor in readonly mode.
Add a guard for potentially undefined functions in scroll section. Allow arrow and home, end keys in readonly mode. Signed-off-by: Gökay Şatır <gokaysatir@gmail.com> Change-Id: Ie695ebf2cd14f49fbb4db2b9ba8f81df5b289591
Diffstat (limited to 'browser/src/map/handler/Map.Keyboard.js')
-rw-r--r--browser/src/map/handler/Map.Keyboard.js16
1 files changed, 3 insertions, 13 deletions
diff --git a/browser/src/map/handler/Map.Keyboard.js b/browser/src/map/handler/Map.Keyboard.js
index b61e81c1e9..96991a57cc 100644
--- a/browser/src/map/handler/Map.Keyboard.js
+++ b/browser/src/map/handler/Map.Keyboard.js
@@ -328,7 +328,7 @@ L.Map.Keyboard = L.Handler.extend({
},
_setPanOffset: function (pan) {
- var keys = this._panKeys = {},
+ var keys = {},
codes = this.navigationKeyCodes,
i, len;
@@ -594,18 +594,8 @@ L.Map.Keyboard = L.Handler.extend({
else if (ev.type === 'keydown') {
var key = ev.keyCode;
var map = this._map;
- if (key in this._panKeys && !ev.shiftKey) {
- if (map._panAnim && map._panAnim._inProgress) {
- return;
- }
- map.fire('scrollby', {x: this._panKeys[key][0], y: this._panKeys[key][1]});
- }
- else if (key in this._panKeys && ev.shiftKey &&
- !docLayer._textCSelections.empty()) {
- // if there is a selection and the user wants to modify it
- if (keyEventFn) {
- keyEventFn('input', charCode, unoKeyCode);
- }
+ if (['ArrowLeft', 'ArrowRight', 'ArrowUp', 'ArrowDown', 'Home', 'End'].includes(ev.code)) {
+ keyEventFn('input', charCode, unoKeyCode);
}
else if (key in this._zoomKeys) {
map.setZoom(map.getZoom() + (ev.shiftKey ? 3 : 1) * this._zoomKeys[key], null, true /* animate? */);