iOS: Don't hide keyboard on "Done" button when focus object has changed
If the focus object changed programmatically for example to the next input field in a window, we want to keep the keyboard open. This strangely only worked if the inputs had different IM hints because this made the keyboard appear again. Change-Id: I52e66bb7d2ff97ae7084173769d9b5c2d0c549b5 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
This commit is contained in:
parent
bace82bffe
commit
8885344ad4
@ -925,6 +925,14 @@
|
||||
if ([text isEqualToString:@"\n"]) {
|
||||
[self sendKeyPressRelease:Qt::Key_Return modifiers:Qt::NoModifier];
|
||||
|
||||
// An onEnter handler of a TextInput might move to the next input by calling
|
||||
// nextInput.forceActiveFocus() which changes the focusObject.
|
||||
// In that case we don't want to hide the VKB.
|
||||
if (focusObject != QGuiApplication::focusObject()) {
|
||||
qImDebug() << "focusObject already changed, not resigning first responder.";
|
||||
return;
|
||||
}
|
||||
|
||||
if (self.returnKeyType == UIReturnKeyDone || self.returnKeyType == UIReturnKeyGo
|
||||
|| self.returnKeyType == UIReturnKeySend || self.returnKeyType == UIReturnKeySearch)
|
||||
[self resignFirstResponder];
|
||||
|
Loading…
Reference in New Issue
Block a user