Adds a space after inserting the username to avoid issues in some keyboards.
This commit is contained in:
+2
-2
@@ -193,7 +193,7 @@ class UserSuggestionState(
|
|||||||
item: User,
|
item: User,
|
||||||
): TextFieldValue {
|
): TextFieldValue {
|
||||||
val lastWordStart = message.selection.end - word.length
|
val lastWordStart = message.selection.end - word.length
|
||||||
val wordToInsert = "@${item.pubkeyNpub()}"
|
val wordToInsert = "@${item.pubkeyNpub()} "
|
||||||
|
|
||||||
return TextFieldValue(
|
return TextFieldValue(
|
||||||
message.text.replaceRange(lastWordStart, message.selection.end, wordToInsert),
|
message.text.replaceRange(lastWordStart, message.selection.end, wordToInsert),
|
||||||
@@ -206,7 +206,7 @@ class UserSuggestionState(
|
|||||||
word: String,
|
word: String,
|
||||||
item: User,
|
item: User,
|
||||||
) {
|
) {
|
||||||
val wordToInsert = "@${item.pubkeyNpub()}"
|
val wordToInsert = "@${item.pubkeyNpub()} "
|
||||||
state.edit {
|
state.edit {
|
||||||
val lastWordStart = selection.end - word.length
|
val lastWordStart = selection.end - word.length
|
||||||
replace(lastWordStart, selection.end, wordToInsert)
|
replace(lastWordStart, selection.end, wordToInsert)
|
||||||
|
|||||||
Reference in New Issue
Block a user