UITextField Input Issue While Using Bilingual Keyboard in iOS 18

Input issues occur in the textField while using a bilingual keyboard (Korean and English).

System settings:
Keyboard: Bilingual (Korean & English)

Project environment:
Xcode >= 15.4 & iOS >= 18.0
Base localization: Korean
// UITextField settings:
textField.keyboardType = .decimalPad // or .phonePad
self.textField.addTarget(self, action: #selector(self.textFieldEditingChanged), for: .editingChanged)

@objc
func textFieldEditingChanged() {
    self.textField.text = "\(self.textField.text!)-"
}

/*
Input: 123456
Expected: 1-2-3-4-5-6-
Result: 11111123456-
*/

The issue occurs when modifying the text of the textField in the editingChanged event.

In the above code, a hyphen is appended to the input with each character.

When typing 123456, the expected result is:

Input: 1 → Result: 1-

Input: 2 → Result: 1-2-

Input: 6 → Result: 1-2-3-4-5-6-

However, the actual result is 11111123456-.

Another example:

@objc
func textFieldEditingChanged() {
    print("before", self.textField.text!)
    self.textField.text = self.textField.text?.replacingOccurrences(of: "0", with: "1")
    print("after", self.textField.text!)
}

When inputting 0 1 0 sequentially, the output is:

before 0 after 1

before 01 after 11

before 010 after 111

The value of "after" matches expectations,

but the "before" value reverts to 0 on the next input, even though it appears as 1 on the UI.

When the bilingual keyboard option is turned off or the base localization is set to something other than Korea, the issue does not occur.

Could you provide information on whether this issue will be resolved in the next iOS version, or if there is a workaround?

The issue you described is interesting to me, yet I failed to reproduce the issue by running your project. Here is what I tried:

  1. Download your project, build it with Xcode 16.0 (16A242d), and run it on my iPhone 16 Pro Max simulator + iOS 18.0 (22A3351).

  2. Type "123456" in the text field (with black background) in your app.

At step 2, I observe that the output is "1-2-3-4-5-6-".

I also switched the system language to Korea, and made sure the "Korea & English (US)" keyboard was in the keyboard list in Settings, but the result was the same.

Do I need to do anything to be able to reproduce the issue.

Secondly, did you try to use textField(_:shouldChangeCharactersIn:replacementString:), instead of .editingChanged? The delegate method is designed for confirming or replacing an input, which I think fits your use case.

Best,
——
Ziqiao Chen
 Worldwide Developer Relations.

@DTS Engineer

  1. This issue only occurs when the keyboard is set to bilingual mode. Please try removing keyboardType and check if the keyboard is in bilingual mode. Additionally, it has been confirmed that the issue occurs regardless of the keyboardType.

  2. In Korean, which is a combinational script, when limiting the number of characters in a field, using the delegate method can result in the last character not being fully formed, causing input issues.

  3. This bug also occurs in text views and has been observed in several commercial apps.

Thanks for the clarification. Given that, I don't see anything you as an app developer can do, and would suggest that you file a feedback report to see what the system keyboard team has to say – If you do so, please share your report ID here for folks to track.

Best,
——
Ziqiao Chen
 Worldwide Developer Relations.

@DTS Engineer

Could you explain in detail how to submit a feedback report to the System Keyboard Team? It seems that there are no tags related to the keyboard in the forum topics.

How to file a feedback report is detailed here: <http://developer.apple.com/bug-reporting/>.

You can't assign your feedback report to a team at Apple when filing a feedback report. That's actually why I asked that you share your feedback report ID – If you do so, Apple folks here may make sure that your feedback report goes to the right team.

Filing a feedback report is the formal way to provide your feedback to Apple. As the originator, you can log into the Feedback Assistant (https://feedbackassistant.apple.com) to see the status of the issue, or add comments, which the team will see when prioritizing their work.

We don’t guarantee to reply every feedback, but the relevant engineering team will for sure review it, and eventually conclude how to proceed.

Best,
——
Ziqiao Chen
 Worldwide Developer Relations.

@DTS Engineer Thank you for kind explanation. I submitted it using the Feedback assistant, and my report id is FB15494670

UITextField Input Issue While Using Bilingual Keyboard in iOS 18
 
 
Q