Commit a82fd289 authored by Richard Moe Gustavsen's avatar Richard Moe Gustavsen
Browse files

EditMenu iOS: show edit menu upon pressnhold on empty input field


If you press and hold on an input field that doesn't have focus, we
select the word under the cursor, which will make the menu show.
But if the field is empty, no word can be selected, so therefore no
menu will show.
This patch will check for this special case, and show the menu if
you pressnhold on an empty input field.

Change-Id: I7d2c137765471cb1ff1dc4f7e34577e5e1317dc0
Reviewed-by: default avatarJ-P Nurmi <jpnurmi@theqtcompany.com>
Showing with 2 additions and 1 deletion
......@@ -114,7 +114,8 @@ Item {
onPressAndHold: {
var pos = input.positionAt(mouseArea.mouseX, mouseArea.mouseY);
input.select(pos, pos);
if (!control.menu || !input.activeFocus || (selectionStart != selectionEnd)) {
var hasSelection = selectionStart != selectionEnd;
if (!control.menu || (input.length > 0 && (!input.activeFocus || hasSelection))) {
selectWord();
} else {
// We don't select anything at this point, the
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment