AppFlowy-IO / AppFlowy-IO/appflowy-editor

[Bug] Korean Input Bug (include debugging information)

Aperta
#1,028 3 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Dart
Stelle
684
Fork
329
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

### 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.

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.