Bug 179602 - [iOS third party keyboard] Keyboard got wrong output when type fast with delete and insert
Summary: [iOS third party keyboard] Keyboard got wrong output when type fast with dele...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: Other
Hardware: iPhone / iPad All
: P2 Critical
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2017-11-13 00:13 PST by Seungyoun Yi
Modified: 2022-02-09 10:14 PST (History)
3 users (show)

See Also:


Attachments
WebKit Log (1.45 MB, image/png)
2017-11-13 00:13 PST, Seungyoun Yi
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Seungyoun Yi 2017-11-13 00:13:38 PST
Created attachment 326749 [details]
WebKit Log

Hello, This is Seungyoun Yi from Naver Corp in South Korea.
Although I reported this bug in APPLE bug reporter Radar#34969608(https://bugreport.apple.com/web/?problemID=34969608), I think this bug is also related to WebKit. Thus, I will report this bug here too. 
You can see full issue in this link(https://github.com/younatics/Apple_Korean_keyboard_bug_report). 

As I see some logs in iOS Console when I typed fast(See attachment), I saw some network response in com.apple.WebKit.WebContent. 
Maybe, some responses are not work correctly. As I saw `didReceiveData ` and `didFinishResourceLoad ` consecutively at the end of this log, but front of log only shows me that response is not return correctly. 
When I typed fast with iOS Keyboard extension, this issue is happened always. More, this issue cause us bunch of CS to our company. 

This is not just for our problem, every third party keyboard got struggled with this issue.
Please fix this issue with Apple Keyboard Team.

Best regards,
Seungyoun Yi'

---
This is full issue that I reported in Apple Bug reporter.

Hello Apple keyboard team. I'm developer in South Korea, developing Korean keyboard in Naver corporation. 
Korean is different then other languages and we found critical bug in typing Korean in Safari or other webview. 

For example, 
if I insert text -> [self.textDocumentProxy insertText:@"ㅇ"];
// output: ㅇ
and want to make chracter, 우
we have to delete chracter -> [self.textDocumentProxy deleteBackward];
and insert again -> [self.textDocumentProxy insertText:@"우"];
// output: 우
Same, 
[self.textDocumentProxy deleteBackward];
[self.textDocumentProxy insertText:@"워"];
// output: 워

[self.textDocumentProxy deleteBackward];
[self.textDocumentProxy insertText:@"원"];
// output: 원

[self.textDocumentProxy deleteBackward];
[self.textDocumentProxy insertText:@"웑"];
// output: ㅇ + ㅜ + ㅓ + ㄴ + ㅈ-> 웑

But in this case, we have to delete and make 2 words
[self.textDocumentProxy deleteBackward];
[self.textDocumentProxy insertText:@"원재"];
// output: ㅇ + ㅜ + ㅓ + ㄴ + ㅈ + ㅐ -> 원재

Because of distinct characteristics, we found bug as you can see in my comment GIF file(korean_in_webview.gif). 
This GIF file shows how we type "우원재" as I explained first. 
If we type fast, unusual word appeared in webview. However this is not happened in Apple normal Korean keyboard.

So, 
- Is there any different logic in Apple normal Korean keyboard?
- If I can help you, I certainly help you to develop Korean keyboard. 
Thanks!

More, I think lifecycle of keyboard is changed in iOS11. When keyboard appear and close, every lifecycle is called. 
Thus, our keyboard is crashed and normal keyboard came up as you can see in another gif file(keyboard_lifecycle_in_iOS11.gif)
Could you give me some advice for this situation?

Thanks again,
Best regards
Seungyoun Yi
---
Comment 1 Alexey Proskuryakov 2017-11-13 18:59:21 PST
rdar://problem/34969608
Comment 2 Wenson Hsieh 2017-11-13 19:13:29 PST
Hi Seungyoun,

Just to make sure — this also reproduces native (non-WebKit) apps, not just WebKit-based apps, correct?

Also, when reproducing in WebKit-based apps, were you using WKWebView or UIWebView?

Thanks!
Comment 3 Seungyoun Yi 2017-11-13 19:42:19 PST
Great pleasure that I got fast response! 
Thanks WebKit Team.

As I tested this application(keyboardsample) in iOS Memo application and iMessage application, this issue is not happened. 

This bug only reproduced by WebView based text input include iOS Safari application in iOS 11.1 or lower iOS version. 

I am not sure this happened in UIWebView. However, I can see bug happened in WKWebView 100%.

If you have any question, you can send me an e-mail to private e-mail or company e-amil (seungyoun.yi@navercrop.com). 

Thanks! 
Seungyoun Yi
Comment 4 Seungyoun Yi 2017-11-13 22:42:00 PST
Oops my company e-mail is wrong. Send me an e-amil to seungyoun.yi@navercorp.com