summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/plugins/platforms/ios/qiosinputcontext.mm15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/plugins/platforms/ios/qiosinputcontext.mm b/src/plugins/platforms/ios/qiosinputcontext.mm
index aebf8fff8f..69bdf4aa87 100644
--- a/src/plugins/platforms/ios/qiosinputcontext.mm
+++ b/src/plugins/platforms/ios/qiosinputcontext.mm
@@ -68,6 +68,7 @@ static QUIView *focusView()
@private
QIOSInputContext *m_context;
}
+@property BOOL hasDeferredScrollToCursor;
@end
@implementation QIOSKeyboardListener
@@ -80,6 +81,8 @@ static QUIView *focusView()
m_context = context;
+ self.hasDeferredScrollToCursor = NO;
+
// UIGestureRecognizer
self.enabled = NO;
self.cancelsTouchesInView = NO;
@@ -231,9 +234,14 @@ static QUIView *focusView()
qImDebug() << "keyboard was hidden, disabling hide-keyboard gesture";
self.enabled = NO;
} else {
- qImDebug() << "gesture completed without triggering, scrolling view to cursor";
- m_context->scrollToCursor();
+ qImDebug() << "gesture completed without triggering";
+ if (self.hasDeferredScrollToCursor) {
+ qImDebug() << "applying deferred scroll to cursor";
+ m_context->scrollToCursor();
+ }
}
+
+ self.hasDeferredScrollToCursor = NO;
}
@end
@@ -418,7 +426,8 @@ void QIOSInputContext::scrollToCursor()
if (m_keyboardHideGesture.state == UIGestureRecognizerStatePossible && m_keyboardHideGesture.numberOfTouches == 1) {
// Don't scroll to the cursor if the user is touching the screen and possibly
// trying to trigger the hide-keyboard gesture.
- qImDebug() << "preventing scrolling to cursor as we're still waiting for a possible gesture";
+ qImDebug() << "deferring scrolling to cursor as we're still waiting for a possible gesture";
+ m_keyboardHideGesture.hasDeferredScrollToCursor = YES;
return;
}