summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/ios
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@qt.io>2019-10-02 15:03:35 +0200
committerTor Arne Vestbø <tor.arne.vestbo@qt.io>2019-10-04 22:37:29 +0000
commite00d888daefbfbd5f17e0772421773f8e295087b (patch)
tree37d887833a641f32bc061b91002ff254ea75591f /src/plugins/platforms/ios
parent5aa13ea144cff4dbadf12c08b7aa49646347e186 (diff)
iOS: Prevent UIKit from adding UITextInteraction to our view
It's added automatically when some languages such as Japanese are the active input language/keyboard, which results in UIKit triggering the edit menu for any tap in the UI, regardless of whether it hits the focus object or not. Adopting the protocol is a much larger effort and needs to be coordinated so that we still support text interaction on iOS versions pre 13.0. Even with this patch the UITextSelectionView will still blink its own cursor, which doesn't seem to sync up with the UITextInput protocol's view of where the cursor is. Fixes: QTBUG-78496 Change-Id: I61500ad7ab9c8577f71188c0c99ead39465e3839 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'src/plugins/platforms/ios')
-rw-r--r--src/plugins/platforms/ios/quiview.mm12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/plugins/platforms/ios/quiview.mm b/src/plugins/platforms/ios/quiview.mm
index e64c05d099..4e3657ec37 100644
--- a/src/plugins/platforms/ios/quiview.mm
+++ b/src/plugins/platforms/ios/quiview.mm
@@ -628,6 +628,18 @@ Q_LOGGING_CATEGORY(lcQpaTablet, "qt.qpa.input.tablet")
#endif
}
+#if QT_IOS_PLATFORM_SDK_EQUAL_OR_ABOVE(130000)
+- (void)addInteraction:(id<UIInteraction>)interaction
+{
+ if (__builtin_available(iOS 13.0, *)) {
+ if ([interaction isKindOfClass:UITextInteraction.class])
+ return; // Prevent iOS from adding UITextInteraction
+ }
+
+ [super addInteraction:interaction];
+}
+#endif
+
@end
@implementation UIView (QtHelpers)