[Android] Typing right after a mention with Samsung Keyboard removes the mention
Los mantenedores suelen responder en 2 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 55/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- android, react-native
- Área
- mobile-dev
Línea de trabajo
Reproduce on the example app's test screen: Set Value with the <mention> markup, place the caret after Doe, and type x with Samsung Keyboard while watching the two onChangeHtml calls. Then trace the Android composing-text path (setComposingText) into detectActiveMention and setMention to see where the mention range is recomputed and stripped. Done means the edit emits <p><mention ...>@John Doe</mention>x</p> and an Android test covers the composing-word append case.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Description
With Samsung Keyboard, the first character typed immediately after a mention (no space in between) lands inside the mention span, and the mention is then stripped. The tag and its attributes are gone even though the user never touched the mention text.
It happens with both the English and the Korean layout. It does not happen when the same character is sent without an IME (adb shell input text), so the editing logic on its own keeps the mention.
Steps to reproduce
Device: Galaxy Z Flip7, Android 16, Samsung Keyboard 5.9.30.97. Library: main at 23cc179d, example app.
- Open the example app and go to the test screen.
- Tap Set Value and submit:
<html><p><mention text="@John Doe" indicator="@" data-id="1">@John Doe</mention></p></html> - Tap the editor so the caret sits right after
Doe. - Type
xon Samsung Keyboard.
Result
onChangeHtml fires twice for that one key press:
<p><mention text="@John Doe" indicator="@" data-id="1">@John Doex</mention></p>
<p>@John Doex</p>
Expected (this is also what adb shell input text x produces from the same state):
<p><mention text="@John Doe" indicator="@" data-id="1">@John Doe</mention>x</p>
The Korean layout behaves the same way with the first jamo: @John Doeㅇ shows up inside the mention, then the mention is removed.
Likely cause
I haven't confirmed this in a debugger. Samsung Keyboard seems to treat Doe plus the new character as a single composing word and rewrites the whole word through setComposingText. The mention span then covers the new character, its text stops matching the stored mention text, and detectActiveMention strips it as an edited mention.
This looks like the mention version of #734 / #737, which deal with inline styles when a predictive keyboard rewrites the composing word.
Notes
- Where this shows up in practice: the user picks a mention, deletes the space
setMentionadds, and types a suffix. In Korean that is the normal way to write, because particles attach directly to a name. - Happy to open a PR once there is a direction you are comfortable with. One option is to keep the mention span on its original range when a composing replacement only appends after it.
- Lenguaje dominante
- C
- Estrellas
- 1.4k
- Forks
- 80
- Merge medio
- 4 d 19 h
- PR fusionados (30 d)
- 21
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Sin guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de software-mansion/react-native-enriched-html
-
[Web] Leading, trailing, and consecutive spaces in <p> and <codeblock> are stripped by setContent on mount / setValuePosiblemente ocupada @pcbeingused333 la tomó hace 2 días. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 25/100
software-mansion/react-native-enriched-html#886 ·
Los mantenedores suelen responder en 2 días
-
bug
Dificultad 3/5 1-2 días Aptitud para principiantes 74/100
software-mansion/react-native-enriched-html#885 ·
Los mantenedores suelen responder en 2 días
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
software-mansion/react-native-enriched-html#881 · 1 comentario ·
Los mantenedores suelen responder en 2 días
-
bug
Dificultad 3/5 1-2 días Aptitud para principiantes 58/100
software-mansion/react-native-enriched-html#880 ·
Los mantenedores suelen responder en 2 días
-
[Android] Leading and consecutive spaces are lost when HTML is parsed (iOS keeps them)Posiblemente ocupada @szydlovsky la tomó hace 1 día. Abierto
Dificultad 3/5 1-2 días Aptitud para principiantes 35/100
software-mansion/react-native-enriched-html#877 · 1 comentario · 1 asignado ·
Los mantenedores suelen responder en 2 días
Todos los issues de software-mansion/react-native-enriched-html
Issues similares
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 75/100
ly05010419/MacNativeGames#2428 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 1/5 Menos de una hora Aptitud para principiantes 92/100
ChupathingyCE/chupathingyce#2063 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
FujiNetWIFI/fujinet-firmware#2545 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
Los mantenedores suelen responder en 1 día