codemirror / dev

Development repository for the CodeMirror editor project
https://codemirror.net/
Other
5.94k stars 376 forks source link

Unable to type properly on iPad using external keyboard with Caps Lock on. #1464

Closed mc-public closed 1 week ago

mc-public commented 2 weeks ago

Describe the issue

Summary

When connecting an external keyboard to an iPad and turning on the Caps Lock, each keystroke will cause the input method to switch. This results in multi-stage input methods being interrupted each time they are combined.

Current Behavior (@codemirror/view 6.34.2)

https://github.com/user-attachments/assets/6e99b3d9-f42a-4084-81c2-6c8b523aa585

Reproduction Steps:

  1. Make sure you have two different language input methods (e.g. English and Chinese).
  2. Connect an external keyboard to the iPad.
  3. Open https://codemirror.net/try/?example=Minimal%20editor.
  4. Turn on caps lock. Then input some random numbers.
  5. Every keystroke causes the input method to quickly switch once, which prevents normal input of Chinese, Japanese, etc. The latter part of the video reflects this issue.

Browser and platform

iOS 18.1; Safari

Reproduction link

https://codemirror.net/try/?example=Minimal%20editor

mc-public commented 1 week ago

After careful investigation, this appears to be an issue with the text input system of iOS. When testing the behavior of this issue, I used the keyboard control of macOS to control the iPad. The Chinese and Japanese keyboard on macOS sends both the CapsLock and the command of the pressed key when CapsLock is enabled. This issue can be reproduced in any input field in iOS 18.0. I apologize for any inconvenience caused and I will now close this issue.

marijnh commented 1 week ago

Hm, that's what I was afraid of—there's no way for JavaScript code to switch the keyboard language. Unfortunately, iOS has quite a few bugs like this that impact web editors.