diff options
author | Markus Goetz <markus@woboq.com> | 2015-12-14 09:58:04 +0100 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@theqtcompany.com> | 2015-12-17 13:47:23 +0000 |
commit | e78ca787ae459f2769a6b0126dad4700408bfb46 (patch) | |
tree | a93d2e123376f59b07228b3eb433a99b051ddc20 /src/plugins/platforms/ios | |
parent | 8885344ad48abe9a707868ce5677f32b05338a50 (diff) |
iOS: Clear focusObject if first responder is set to null
In certain cases we were still showing a cursor in a TextInput even
though the keyboard was hidden programmatically.
Change-Id: I48ebb6b8bc0382236b1ea5835e68eae48ece2b4f
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
Diffstat (limited to 'src/plugins/platforms/ios')
-rw-r--r-- | src/plugins/platforms/ios/qiostextresponder.mm | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/plugins/platforms/ios/qiostextresponder.mm b/src/plugins/platforms/ios/qiostextresponder.mm index e6ea43652f..320b1cac61 100644 --- a/src/plugins/platforms/ios/qiostextresponder.mm +++ b/src/plugins/platforms/ios/qiostextresponder.mm @@ -318,7 +318,11 @@ // a regular responder transfer to another window. In the former case, iOS // will set the new first-responder to our next-responder, and in the latter // case we'll have an active responder candidate. - if ([UIResponder currentFirstResponder] == [self nextResponder]) { + if (![UIResponder currentFirstResponder]) { + // No first responder set anymore, sync this with Qt by clearing the + // focus object. + m_inputContext->clearCurrentFocusObject(); + } else if ([UIResponder currentFirstResponder] == [self nextResponder]) { // We have resigned the keyboard, and transferred first responder back to the parent view Q_ASSERT(!FirstResponderCandidate::currentCandidate()); if ([self currentImeState:Qt::ImEnabled].toBool()) { |