IOS: Hide keyboard when rotating to landscape

On iOS12 at least, the rotation did not force the keyboard to hide. This
fix will force it to be retracted in landscape and restored when
rotating back to the portrait position.
This commit is contained in:
Jozef Legény 2018-09-05 06:41:01 +02:00 committed by David Turner
parent 15306581ab
commit b705262b09

View File

@ -870,6 +870,13 @@ uint getSizeNextPOT(uint size) {
- (void)deviceOrientationChanged:(UIDeviceOrientation)orientation {
[self addEvent:InternalEvent(kInputOrientationChanged, orientation, 0)];
BOOL isLandscape = (self.bounds.size.width > self.bounds.size.height);
if (isLandscape) {
[_keyboardView hideKeyboard];
} else {
[_keyboardView showKeyboard];
}
}
- (UITouch *)secondTouchOtherTouchThan:(UITouch *)touch in:(NSSet *)set {