[Android] Typing right after a mention with Samsung Keyboard removes the mention
メンテナーはふだん 2 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 55/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- android, react-native
- 領域
- mobile-dev
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- C
- スター
- 1.4k
- フォーク
- 80
- 平均マージ
- 4日 19時間
- マージ済み PR(30日)
- 21
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
software-mansion/react-native-enriched-html のほかの issue
-
[Web] Leading, trailing, and consecutive spaces in <p> and <codeblock> are stripped by setContent on mount / setValue対応中かも @pcbeingused333 が 2 日前に担当しました。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
software-mansion/react-native-enriched-html#886 ·
メンテナーはふだん 2 日以内に返信
-
bug
難易度 3/5 1〜2日 初心者へのやさしさ 74/100
software-mansion/react-native-enriched-html#885 ·
メンテナーはふだん 2 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
software-mansion/react-native-enriched-html#881 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
-
bug
難易度 3/5 1〜2日 初心者へのやさしさ 58/100
software-mansion/react-native-enriched-html#880 ·
メンテナーはふだん 2 日以内に返信
-
[Android] Leading and consecutive spaces are lost when HTML is parsed (iOS keeps them)対応中かも @szydlovsky が 1 日前に担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
software-mansion/react-native-enriched-html#877 · コメント 1 件 · 担当者 1 名 ·
メンテナーはふだん 2 日以内に返信
software-mansion/react-native-enriched-html の issue をすべて見る
似ている issue
-
[Android Auto] MU1017 (MHI2Q_JP_AUG22_P1017) cluster map works with a pinned profile — values insideオープン
難易度 1/5 1時間未満 初心者へのやさしさ 92/100
kamgurgul/mib2q-carplay#74 ·
-
Claude:NotNeeded GPT:NotABug triage
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
open5gs/open5gs#5195 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
FriendsofECCE/ECCE#1358 ·
-
documentation needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
X11Libre/xserver#4255 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 84/100
antoxa2584x/nfsu2-sw#52 ·