mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2025-06-28 20:29:53 +00:00
android: fix entering characters while sending a message (#5615)
This commit is contained in:
parent
a91599543e
commit
38c5c19b17
1 changed files with 4 additions and 2 deletions
|
@ -122,8 +122,10 @@ actual fun PlatformTextField(
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onSelectionChanged(selStart: Int, selEnd: Int) {
|
override fun onSelectionChanged(selStart: Int, selEnd: Int) {
|
||||||
onMessageChange(ComposeMessage(text.toString(), TextRange(minOf(selStart, selEnd), maxOf(selStart, selEnd))))
|
val start = minOf(text.length, minOf(selStart, selEnd))
|
||||||
super.onSelectionChanged(selStart, selEnd)
|
val end = minOf(text.length, maxOf(selStart, selEnd))
|
||||||
|
onMessageChange(ComposeMessage(text.toString(), TextRange(start, end)))
|
||||||
|
super.onSelectionChanged(start, end)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
editText.layoutParams = ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)
|
editText.layoutParams = ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue