AppFlowy-IO / AppFlowy-IO/appflowy-editor

[Bug] Korean Input Bug (include debugging information)

Abierto
#1,028 3 comentarios 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
Dart
Estrellas
684
Forks
329
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

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

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.