Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
tdf#133279: Fix typing into tunnelled dialogs on hardware keyboards i…
…n iOS app

Let's hope this doesn't have any unintended side effect.

Change-Id: I38d5c6f3a8526ce510fe07f58fba17e98eb09e2e
Signed-off-by: Tor Lillqvist <tml@collabora.com>
  • Loading branch information
Tor Lillqvist authored and tml1024 committed Nov 11, 2020
1 parent dbca043 commit b5ea481
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions loleaflet/src/layer/marker/TextInput.js
Expand Up @@ -275,12 +275,12 @@ L.TextInput = L.Layer.extend({

// Trick to avoid showing the software keyboard: Set the textarea
// read-only before focus() and reset it again after the blur()
if (navigator.platform !== 'iPhone') {
if (!window.ThisIsTheiOSApp && navigator.platform !== 'iPhone') {
if ((window.ThisIsAMobileApp || window.mode.isMobile()) && acceptInput !== true)
this._textArea.setAttribute('readonly', true);
}

if (navigator.platform !== 'iPhone') {
if (!window.ThisIsTheiOSApp && navigator.platform !== 'iPhone') {
this._textArea.focus();
} else if (acceptInput === true) {
// On the iPhone, only call the textarea's focus() when we get an explicit
Expand All @@ -302,7 +302,7 @@ L.TextInput = L.Layer.extend({
this._textArea.focus();
}

if (navigator.platform !== 'iPhone') {
if (!window.ThisIsTheiOSApp && navigator.platform !== 'iPhone') {
if ((window.ThisIsAMobileApp || window.mode.isMobile()) && acceptInput !== true) {
this._setAcceptInput(false);
this._textArea.blur();
Expand All @@ -329,7 +329,7 @@ L.TextInput = L.Layer.extend({
}

this._setAcceptInput(false);
if (navigator.platform !== 'iPhone')
if (!window.ThisIsTheiOSApp && navigator.platform !== 'iPhone')
this._textArea.blur();
},

Expand Down

0 comments on commit b5ea481

Please sign in to comment.