Skip to content

Commit

Permalink
Firefox 42 ESR workaround.
Browse files Browse the repository at this point in the history
We get a single exception during setup from setSelectionRange,
presumably when the textArea is not focused. That causes a leak
of _ignoreInputCount - which kills text input.

So catch and ignore the exception.

Change-Id: I3fdfff99344f53b03ebadec2e551d7ee70416334
Signed-off-by: Michael Meeks <[email protected]>
  • Loading branch information
mmeeks committed Mar 3, 2021
1 parent cedf950 commit 4c4c02b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion loleaflet/src/layer/marker/TextInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -809,7 +809,11 @@ L.TextInput = L.Layer.extend({

// avoid setting the focus keyboard
if (!noSelect) {
this._textArea.setSelectionRange(1, 1);
try {
this._textArea.setSelectionRange(1, 1);
} catch (err) {
// old firefox throws an exception on start.
}

if (this._hasWorkingSelectionStart === undefined)
this._hasWorkingSelectionStart = (this._textArea.selectionStart === 1);
Expand Down

0 comments on commit 4c4c02b

Please sign in to comment.