[escher/text_field] Fix Cut event when selection

This commit is contained in:
Léa Saviot
2020-01-08 14:31:36 +01:00
parent e161d42839
commit e3d06d87fb

View File

@@ -372,9 +372,11 @@ bool TextField::privateHandleEvent(Ion::Events::Event event) {
if (event == Ion::Events::Copy || event == Ion::Events::Cut) {
storeInClipboard();
if (event == Ion::Events::Cut) {
reinitDraftTextBuffer();
resetSelection();
setEditing(true);
if (!m_contentView.selectionIsEmpty()) {
deleteSelection();
} else {
removeWholeText();
}
}
return true;
}