mirror of
https://gitlab.com/cc-ru/ocelot/ocelot-desktop.git
synced 2025-12-19 18:49:19 +01:00
Fix cursor positioning on TextInput text set
This commit is contained in:
parent
4e9d7c96e2
commit
6f5f84e5fd
@ -71,6 +71,7 @@ class TextInput(val initialText: String = "") extends Widget with MouseHandler w
|
||||
def text_=(value: String): Unit = {
|
||||
_text.chars = value.codePoints().toArray
|
||||
selector.active = false
|
||||
cursor.position = cursor.position max 0 min _text.chars.length
|
||||
}
|
||||
|
||||
private def selectedText: String = new String(_text.chars, selector.start, selector.length)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user