From 2d019ddc93c8139950c92ba09a3234f12462d024 Mon Sep 17 00:00:00 2001 From: Richard Moe Gustavsen Date: Tue, 22 Apr 2014 12:57:37 +0200 Subject: iOS: scroll screen after hiding keyboard programatically MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When the keyboard is told to hide, we resign first responder. If this is done programatically on touch press, this will make the "hide keyboard gesture" receive a touchesCancelled instead of a touchesEnded. Since we didn't catch this from before, the gesture was left in a mixed state causing the screen not to scroll when later showing the keyboard. Change-Id: I70ed59710128a912097cd5bfbdd8f49b20b7934c Reviewed-by: Tor Arne Vestbø --- src/plugins/platforms/ios/qiosinputcontext.mm | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/plugins/platforms/ios/qiosinputcontext.mm') diff --git a/src/plugins/platforms/ios/qiosinputcontext.mm b/src/plugins/platforms/ios/qiosinputcontext.mm index 9a2c55f7f2..8be3846e06 100644 --- a/src/plugins/platforms/ios/qiosinputcontext.mm +++ b/src/plugins/platforms/ios/qiosinputcontext.mm @@ -229,6 +229,13 @@ [super touchesEnded:touches withEvent:event]; } +- (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event +{ + m_touchPressWhileKeyboardVisible = NO; + [self performSelectorOnMainThread:@selector(touchesEndedPostDelivery) withObject:nil waitUntilDone:NO]; + [super touchesCancelled:touches withEvent:event]; +} + - (void)touchesEndedPostDelivery { // Do some clean-up _after_ touchEnd has been delivered to QUIView -- cgit v1.2.3