[escher/text_area/field] When pasting, force cursor right of text

This commit is contained in:
Léa Saviot
2020-01-10 11:44:16 +01:00
parent c03c9086b8
commit a42b52d10e
2 changed files with 2 additions and 2 deletions

View File

@@ -147,7 +147,7 @@ bool TextArea::handleEvent(Ion::Events::Event event) {
return true;
}
if (event == Ion::Events::Paste) {
return handleEventWithText(Clipboard::sharedClipboard()->storedText());
return handleEventWithText(Clipboard::sharedClipboard()->storedText(), false, true);
}
// The following events need a scrollToCursor and return true

View File

@@ -437,7 +437,7 @@ bool TextField::handleEvent(Ion::Events::Event event) {
} else if (event.hasText()) {
return handleEventWithText(event.text());
} else if (event == Ion::Events::Paste) {
return handleEventWithText(Clipboard::sharedClipboard()->storedText());
return handleEventWithText(Clipboard::sharedClipboard()->storedText(), false, true);
} else if ((event == Ion::Events::OK || event == Ion::Events::EXE) && !isEditing()) {
const char * previousText = m_contentView.text();
setEditing(true);