Bug 279904

Summary: Upon upgrading to iOS 18, on-screen keyboard does not show up for installed web apps (PWAs) when focusing a text input of any kind
Product: WebKit Reporter: John Ozbay <webkit-bugzilla>
Component: UI EventsAssignee: Abrar Rahman Protyasha <a_protyasha>
Status: NEW ---    
Severity: Critical CC: a_protyasha, formularsumo, ik, webkit-bug-importer, wenson_hsieh
Priority: P2 Keywords: InRadar
Version: Safari 18   
Hardware: iPhone / iPad   
OS: iOS 18   
Attachments:
Description Flags
Password Popup I'm referring to
none
Video of the bug happening on iPad OS 18.0 none

Description John Ozbay 2024-09-18 09:11:18 PDT
Hello all,

After upgrading to iOS 18, I launched an installed web app (PWA / home-screen web app), tapped on an input field, and the on-screen keyboard did not show up as expected. 

The problem seems to be happening with all kinds of inputs like text, email, search, number, textarea etc as well as contenteditable.

In short it seems like the soft keyboard is broken for installed web apps on iOS 18.
 
I'm the creator of a document writing / note taking web application. (https://crypt.ee) 
Our application is effectively broken on iOS 18, and this has a direct negative impact on our business as our customers cannot edit / write documents anymore.

• Quitting and relaunching the app does not seem to solve the problem.
• Switching back and forth between apps does not seem to solve the problem. 

• Strangely enough restarting iOS did solve the problem. 

However, we cannot ask our customers to restart their iOS devices unless they reach out to our customer support. 
They assume it's our app that is broken, when it's in fact an iOS 18 bug.  
Since we have no way of detecting if the keyboard is shown or not, we can't show a pop-up to warn our users either. 

So this is critically impacting our business every minute it remains unfixed.

A timely fix would be deeply appreciated. 

Best,

— John Ozbay
Comment 1 Radar WebKit Bug Importer 2024-09-18 10:20:51 PDT
<rdar://problem/136232949>
Comment 2 John Ozbay 2024-09-19 00:59:16 PDT
Upon further testing and feedback from our helpful customers, we have narrowed down the reproduction steps a bit more. 

So far we've been able to reproduce this only on: 

• iPhones that are located in the EU (and has an EU country as their apple id & app store region)

• iPhones that were on iOS 17 when they installed the PWA / home-screen web app

• iPhones that later upgraded to iOS 18, and that's when the keyboard stopped working. 

We have tested, but haven't been able to reproduce this issue on : 

• iPhones that are located outside the EU (and don't have an EU country as their apple id / app store region)

• iPhones that were on iOS 18 when they installed the PWA / home-screen web app. When they install and launch a web app while on iOS 18, things seem to work. 

So it seems like this is an issue affecting existing PWA / home-screen web app users who had the PWA / home-screen web app already installed on iOS 17 and upgraded to iOS 18. (and not new users who installed it while on iOS 18)

Hoping this helps narrow things down,

Best,

— John Ozbay
Comment 3 Wenson Hsieh 2024-09-19 15:18:49 PDT
Hello John!

> • iPhones that were on iOS 17 when they installed the PWA / home-screen web app

Thank you for the information — this is really helpful. For the devices where this issue reproduces, do you happen to know what versions of iOS 17 (in particular, whether it was before or after iOS 17.4) were previously installed, prior to updating to iSO 18?

Thanks,
Wenson
Comment 4 Wenson Hsieh 2024-09-19 15:28:00 PDT
(In reply to Wenson Hsieh from comment #3)
> Hello John!
> 
> > • iPhones that were on iOS 17 when they installed the PWA / home-screen web app
> 
> Thank you for the information — this is really helpful. For the devices
> where this issue reproduces, do you happen to know what versions of iOS 17
> (in particular, whether it was before or after iOS 17.4) were previously
> installed, prior to updating to iSO 18?
> 
> Thanks,
> Wenson

(sp. iOS 18)

Some followup questions as well, which may provide some hints for our investigation:

- You mentioned earlier that this happens with "all kinds of inputs like text, email, …". In the case where it happens, is there a text cursor in the input view at all, or any other indication that the field is focused? (such as an outline around the text field). If you're able to use Web Inspector, evaluating `document.activeElement` in state would be interesting as well. In particular, I'm curious whether the DOM element is not getting focus at all, or if it's getting focus but the system keyboard just isn't coming up. Knowing this would help bisect the problem.

- Related to the above — while in the broken state, are you able to tap on and interact with other DOM elements in the page? I'm curious if this might be explained by some (invisible) UI that's overlaying the web app, which (for some reason) is only inserted into the view hierarchy for users in the EU who updated from iOS 17.

If possible, a screen recording demonstrating the issue would also be helpful, and may provide further hints.
Comment 5 John Ozbay 2024-09-22 04:47:29 PDT
Created attachment 472628 [details]
Password Popup I'm referring to
Comment 6 John Ozbay 2024-09-22 04:47:41 PDT
Hey Wenson, 

Thanks a lot for getting back quickly!

> ... do you happen to know what versions of iOS 17 ... ?

All our devices were on iOS 17.6 before the update (as well as the devices of users and friends who reported they experienced this issue)

> ... is there a text cursor in the input view at all, or any other indication that the field is focused?

I remember being able to tap on fields (as well as contenteditable) and seeing the highlight on the input element. (And one other person who experienced the same mentioned the same) 

— That being said, we still haven't been able to reproduce this to make it possible to send you a screen-capture, and it's taking up a lot of time to reproduce it accurately. Because : 

a) Resetting an iPhone back to iOS 17.6 is no longer possible since it's no longer signed by Apple.

b) Resetting back to 17.6.1, installing PWA, using the phone a bit, then updating to iOS 18, and testing with a PWA etc is very time consuming, so each of our attempts in trying to isolate this takes us about 3hrs minimum. 

c) I'm still not 100% sure, but I have a hunch that it maaaay have to do with the new Passwords app prompt. (see attachment) We had this show up inconsistently every now and then in our tests, and perhaps it maaay be that iOS was trying to show this, it didn't appear on the screen for whatever reason, giving the illusion that there was no keyboard visible. 

So to understand if this is indeed the case, while restoring from iOS 17.6, we have also been trying to log in to iCloud, add a few passwords to a test account, upgrade to iOS 18 etc... It's quite time consuming, and I know how difficult it is to not have something to work off of, so I apologize that we still don't have a screenshot/screen-recording just yet. 

> ... are you able to tap on and interact with other DOM elements in the page?

Yes. In our tests, in Cryptee we were able to open a document — which requires tapping around, and that's the only way we could get to the contenteditable used for editing the document. 

> I'm curious if this might be explained by some (invisible) UI that's overlaying the web app, which (for some reason) is only inserted into the view hierarchy for users in the EU who updated from iOS 17.

I can at least say that for Cryptee, we don't have anything targeting EU specifically in the code. 

I only thought it's worth mentioning this in part because with iOS 18, Apple has some features enabled in the US but not in the EU. (As well as a few EU DMA requirements that are relevant to Safari/Webkit) So figured perhaps it may be one of these rare edge cases in iOS/Webkit that's causing it, and would help you in identifying the root cause faster.

Hoping these help! 

We'll keep testing and investigating as well, and will send you a video as soon as we can reproduce it again on a device.

All the very best from Northern Europe,
J
Comment 7 John Ozbay 2024-09-23 23:42:02 PDT
Created attachment 472663 [details]
Video of the bug happening on iPad OS 18.0
Comment 8 John Ozbay 2024-09-23 23:54:28 PDT
Hey Wenson, 

I finally managed to film the bug. 
<see attachment : Video of the bug happening on iPad OS 18.0>

This is an iPad M2, running iPad OS 18, with no usb or bluetooth keyboards or mice connected, registered to Finland's App Store, and physically in Finland. (So it's in the EU)

This particular iPad was already running iOS 18. So it wasn't an upgrade from iOS 17.6 that caused it. Everything was working as expected, then all of a sudden next time I launched the PWA the keyboard didn't show up. 

It was upgraded from iOS 17.6 -> iOS 18. But again, the keyboard was initially showing up and everything was working. This happened out of the blue on this device. Leading me to think that whatever's happening has less to do with the upgrade itself but iOS/iPad OS 18. 

The keyboard shows up works normally in native apps. But it does not show up in PWA / home-screen web apps. 

As you can see in the video, the inputs receive focus, but the keyboard does not show up. So it's possible to tap around the screen, select text etc, minus the keyboard. 

iPad was in Stage Manager mode, orientation unlocked and plugged in charging. 

To reproduce the bug, I was opening/closing apps, testing side by side, stage manager multi window etc to see if I can get it to happen again. Eventually I opened Cryptee full screen to continue working on other tests (which are not related to this bug) and the keyboard stopped working. 

Hoping this helps, 

Best,

John