summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--browser/src/layer/tile/CanvasTileLayer.js3
-rw-r--r--browser/src/layer/tile/ScrollSection.ts6
-rw-r--r--browser/src/map/handler/Map.Keyboard.js16
3 files changed, 8 insertions, 17 deletions
diff --git a/browser/src/layer/tile/CanvasTileLayer.js b/browser/src/layer/tile/CanvasTileLayer.js
index 392aa6ee0e..702d4f2c05 100644
--- a/browser/src/layer/tile/CanvasTileLayer.js
+++ b/browser/src/layer/tile/CanvasTileLayer.js
@@ -3960,8 +3960,7 @@ L.CanvasTileLayer = L.Layer.extend({
// enable or disable blinking cursor and the cursor overlay depending on
// the state of the document (if the falgs are set)
_updateCursorAndOverlay: function (/*update*/) {
- if (this._map.isEditMode()
- && this._map._isCursorVisible // only when LOK has told us it is ok
+ if (this._map._isCursorVisible // only when LOK has told us it is ok
&& this._map.editorHasFocus() // not when document is not focused
&& !this._map.isSearching() // not when searching within the doc
&& !this._isZooming // not when zooming
diff --git a/browser/src/layer/tile/ScrollSection.ts b/browser/src/layer/tile/ScrollSection.ts
index bfd5f6ff85..f2fe7c8f60 100644
--- a/browser/src/layer/tile/ScrollSection.ts
+++ b/browser/src/layer/tile/ScrollSection.ts
@@ -129,8 +129,10 @@ export class ScrollSection extends CanvasSectionObject {
return;
}
// Triggered by the document (e.g. search result out of the viewing area).
- this.map.scrollTop(e.y, {});
- this.map.scrollLeft(e.x, {});
+ if (this.map.scrollTop && this.map.scrollLeft) {
+ this.map.scrollTop(e.y, {});
+ this.map.scrollLeft(e.x, {});
+ }
}
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
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? */);