AppFlowy-IO / AppFlowy-IO/appflowy-editor

[Bug] Korean Input Bug (include debugging information)

Đang mở
#1,028 3 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Dart
Star
684
Fork
329
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

### Bug Description

Hi. I think many korean people has problem with windows 10 korean IME
The details of bug can find here : https://github.com/AppFlowy-IO/AppFlowy/issues/5357#issuecomment-2123882690

it could be reproduced by typing "xptmxm" in QWERTY keyborad

![Image](https://github.com/user-attachments/assets/edda47a0-91f3-41d9-a865-9cc2dde9eec4)

### How to Reproduce

1. appflowy-editor source commit id : 2a03498
2. just type korean charactors with windows 10 IME

### Expected Behavior

It is okay with Windows 11 IME

![Image](https://github.com/user-attachments/assets/4c66597e-22fa-4b80-bcd7-1337d0f082cb)

### Operating System

windwos 10 and windows 11(with previous version IME)

### AppFlowy Editor Version(s)

4.0.0

### Screenshots

_No response_

### Additional Context

Somthing informations during debugging.

1. WIndows 10 IME vs Windows 11 IME
- WIndows message's order is different.
- windows 11 IME
--> WM_IME_STARTCOMPOSITION
--> WM_IME_COMPOSITION – (lParam & GCS_COMPSTR)
--> WM_IME_COMPOSITION – (lParam & GCS_RESULTSTR)
--> WM_IME_ENDCOMPOSITION
- windows 10 IME
--> WM_IME_STARTCOMPOSITION
--> WM_IME_COMPOSITION – (lParam & GCS_COMPSTR)
--> WM_IME_ENDCOMPOSITION
--> WM_IME_COMPOSITION – (lParam & GCS_RESULTSTR)

2. appflowy debbuging messages
- Windows 10 IME (NOK)
-->TextEditingDeltaReplacement
-->TextEditingDeltaInsertion
--> apply op (local): {op: update, ~~
- Windows 11 IME (OK)
-->TextEditingDeltaReplacement
-->TextEditingDeltaNonTextUpdate
-->TextEditingDeltaNonTextUpdate
-->TextEditingDeltaInsertion
--> apply op (local): {op: update, ~~

3. The direct cause of the bug
- I checked "onInsert" function In "delta_input_on_insert_impl.dart" file
- At the line 75, the blow codes could be found.
final transaction = editorState.transaction
..insertText(
node,
selection.startIndex,
textInserted,
toggledAttributes: editorState.toggledStyle,
sliceAttributes: editorState.sliceUpcomingAttributes,
)
- In "insertText" function and line 228 of "transaction.dart" file,
final insert = Delta()
..retain(index) <<-- windows 10 IME Skip this when problem is occured
..insert(text, attributes: newAttributes);
- The main reason is "selection.startIndex" is different beteewn windows 10 IME and 11 IME

I found thease phenomenons, but i couldn't find the way to fix this.
Please Check this bug. Thanks.

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.