diff --git a/loleaflet/src/layer/marker/ClipboardContainer.js b/loleaflet/src/layer/marker/ClipboardContainer.js index cb7b74a9a..4dfddad7e 100644 --- a/loleaflet/src/layer/marker/ClipboardContainer.js +++ b/loleaflet/src/layer/marker/ClipboardContainer.js @@ -91,6 +91,10 @@ L.ClipboardContainer = L.Layer.extend({ this._textArea.setAttribute('spellcheck', 'false'); }, + activeElement: function () { + return this._textArea; + }, + _setPos: function (pos) { L.DomUtil.setPosition(this._container, pos); } diff --git a/loleaflet/src/layer/tile/TileLayer.js b/loleaflet/src/layer/tile/TileLayer.js index de1269e54..f0e8761a1 100644 --- a/loleaflet/src/layer/tile/TileLayer.js +++ b/loleaflet/src/layer/tile/TileLayer.js @@ -1586,7 +1586,7 @@ L.TileLayer = L.GridLayer.extend({ // the state of the document (if the falgs are set) _updateCursorAndOverlay: function (/*update*/) { if (this._map._permission === 'edit' - && this._map._clipboardContainer._textArea === document.activeElement + && this._map._clipboardContainer.activeElement() === document.activeElement && this._isCursorVisible && this._isCursorOverlayVisible && !this._isEmptyRectangle(this._visibleCursor)) { diff --git a/loleaflet/src/map/handler/Map.Keyboard.js b/loleaflet/src/map/handler/Map.Keyboard.js index 18e49ad4e..d6466e95c 100644 --- a/loleaflet/src/map/handler/Map.Keyboard.js +++ b/loleaflet/src/map/handler/Map.Keyboard.js @@ -252,7 +252,7 @@ L.Map.Keyboard = L.Handler.extend({ compEventFn = L.bind(docLayer._postCompositionEvent, docLayer, 0 /* winid */); } if (!inputEle) { - inputEle = this._map._clipboardContainer._textArea; + inputEle = this._map._clipboardContainer.activeElement(); } this.modifier = 0; var shift = e.originalEvent.shiftKey ? this.keyModifier.shift : 0;