mirror of
https://github.com/element-hq/element-android
synced 2024-11-24 18:35:40 +03:00
basing the emoji ':' search on the current edit text selection to avoid always replacing the last occurrence
This commit is contained in:
parent
dffed4445d
commit
20241f852a
1 changed files with 1 additions and 1 deletions
|
@ -182,7 +182,7 @@ class AutoCompleter @AssistedInject constructor(
|
|||
.with(object : AutocompleteCallback<String> {
|
||||
override fun onPopupItemClicked(editable: Editable, item: String): Boolean {
|
||||
// Detect last ":" and remove it
|
||||
var startIndex = editable.lastIndexOf(":")
|
||||
var startIndex = editable.subSequence(0, editText.selectionStart).lastIndexOf(":")
|
||||
if (startIndex == -1) {
|
||||
startIndex = 0
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue