apache / cordova-ios

Apache Cordova iOS
https://cordova.apache.org/
Apache License 2.0
2.16k stars 989 forks source link

iOS 18 requires text input focus before accepting key events #1492

Open adammeyer opened 1 day ago

adammeyer commented 1 day ago

Bug Report

Problem

What is expected to happen?

Using a bluetooth keyboard, app should accept keyboard events at anytime. Example, arrow keys.

What does actually happen?

Since iOS18, focus on text input is required to "activate" key events. After initial focus in any text input, key events work again throughout the app. This isn't an issue in Safari on iOS 18.

Information

Spin up a new app with https://keyevents.netlify.app/. Picks up key events in iOS 17, does not in iOS 18.

Command or Code

Environment, Platform, Device

iPad, iOS 18

Version information

iOS 18, Cordova iOS 7.1.1

Checklist

dpogue commented 1 day ago

I believe this has been fixed upstream in WebKit now (after a few attempts due to visionOS issues).

For those curious:

Hopefully this will roll out as part of iOS 18.1, unfortunately I don't believe there's anything Cordova can do to address the problem on our side.

I'll leave this issue open for now, and we can reevaluate once iOS 18.1 is released to see if it's resolved or not.