Skip to content

Commit

Permalink
leaflet: calc text selection is never removed
Browse files Browse the repository at this point in the history
problem:
once text inside the cell is selected,
taping on other cell does not remove the selection

Change-Id: I2c4bd4e46a42854bdcc5a09f6af170d33dc4e8c0
Signed-off-by: Pranam Lashkari <lpranam@collabora.com>
  • Loading branch information
lpranam committed Nov 11, 2020
1 parent eb4a36c commit dbca043
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions loleaflet/src/layer/tile/TileLayer.js
Expand Up @@ -1238,6 +1238,7 @@ L.TileLayer = L.GridLayer.extend({

// Remove input help if there is any:
this._removeInputHelpMarker();
this._removeSelection();
},

_removeInputHelpMarker: function() {
Expand Down Expand Up @@ -3281,14 +3282,19 @@ L.TileLayer = L.GridLayer.extend({
this._updateMarkers();
}
else {
this._textSelectionStart = null;
this._textSelectionEnd = null;
this._selectedTextContent = '';
for (var key in this._selectionHandles) {
this._map.removeLayer(this._selectionHandles[key]);
this._selectionHandles[key].isDragged = false;
}
this._removeSelection();
}
},

_removeSelection: function() {
this._textSelectionStart = null;
this._textSelectionEnd = null;
this._selectedTextContent = '';
for (var key in this._selectionHandles) {
this._map.removeLayer(this._selectionHandles[key]);
this._selectionHandles[key].isDragged = false;
}
this._selections.clearLayers();
},

_updateMarkers: function() {
Expand Down

0 comments on commit dbca043

Please sign in to comment.