ui: initialise cursor in fields at the end
By convention and usability reasons, the cursor in a text field should be initialised at the end of the string.embed
parent
cfe6138c44
commit
9de15284d8
|
@ -10,9 +10,9 @@ pub struct UText {
|
|||
impl UText {
|
||||
pub fn new(content: String) -> Self {
|
||||
UText {
|
||||
cursor_pos: content.len(),
|
||||
grapheme_cursor_pos: content.split_graphemes().len(),
|
||||
content,
|
||||
cursor_pos: 0,
|
||||
grapheme_cursor_pos: 0,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue