diff --git a/ui/dr-ui/ui/identity.slint b/ui/dr-ui/ui/identity.slint index 1db0d13..c8d03a2 100644 --- a/ui/dr-ui/ui/identity.slint +++ b/ui/dr-ui/ui/identity.slint @@ -433,7 +433,16 @@ export component IdentityScreen inherits Rectangle { : 0px; visible: root.selected-person >= 0; edited(t) => { root.name-edited(t); } - accepted(t) => { root.rename(t); } + // Enter *finishes* naming this person, so the field lets + // the keyboard go with it. Without this the entry keeps + // focus after the name is committed, and on a tablet the + // on-screen keyboard stays up over the faces the user + // pressed Enter to get back to — the name looks accepted + // and the screen looks stuck. + accepted(t) => { + root.rename(t); + name-field.release-focus(); + } } if root.selected-person < 0: Text { text: "Select a person"; diff --git a/ui/dr-ui/ui/widgets.slint b/ui/dr-ui/ui/widgets.slint index e51156e..18c32a6 100644 --- a/ui/dr-ui/ui/widgets.slint +++ b/ui/dr-ui/ui/widgets.slint @@ -633,6 +633,19 @@ export component Field inherits Rectangle { input.select-all(); } + /// Give the keyboard back. + /// + /// The other half of `take-focus`, and the one a field that *submits* + /// needs: pressing Enter on a name has finished with the name, but Slint + /// leaves the entry focused, so on a tablet the on-screen keyboard stays + /// up covering the very thing the user just named. Nothing else on those + /// screens takes focus on its own, so the field has to let go itself. + /// + /// A function and not a property, for the reason `take-focus` gives. + public function release-focus() { + input.clear-focus(); + } + height: Theme.touch-target; border-radius: Theme.radius; border-width: 1px;