Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-127669

Keyboard closes after swiping from its top edge

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 5.15, 6.7, 6.8
    • None
    • iOS/tvOS/watchOS

    Description

      If you place an input field, and the virtual keyboard is open, you can swipe down from the top edge of the keyboard and it will close. There are no ways to disable this behavior. You can click or swipe anywhere in the app without closing the keyboard. But swiping down near the keyboard closes it.

      Is there a workarount to prevent this? I don't want the keyboard to close (I attached a video of what it looks like).

       

      Here is callstack when the keyboard closes (from Qt 5.15, but I tried in Qt6 also, the same behavior)

      #7    0x00000001021b56e8 in QInputMethod::visibleChanged() at /Users/qt/work/qt/qtbase/src/gui/.moc/debug/moc_qinputmethod.cpp:352
      #8    0x000000010217d80c in QPlatformInputContext::emitInputPanelVisibleChanged() at /Users/qt/work/qt/qtbase/src/gui/kernel/qplatforminputcontext.cpp:225
      #9    0x00000001013c8b0c in QIOSInputContext::updateKeyboardState(NSNotification*) at /Users/qt/work/qt/qtbase/src/plugins/platforms/ios/qiosinputcontext.mm:436
      #10    0x00000001013c831c in -[QIOSKeyboardListener keyboardWillOrDidChange:] at /Users/qt/work/qt/qtbase/src/plugins/platforms/ios/qiosinputcontext.mm:192
      #11    0x00000001013c7de8 in -[QIOSKeyboardListener keyboardWillHide:] at /Users/qt/work/qt/qtbase/src/plugins/platforms/ios/qiosinputcontext.mm:170
      #12    0x00000001a432678c in __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ ()
      #13    0x00000001a43266a8 in ___CFXRegistrationPost_block_invoke ()
      #14    0x00000001a43265f0 in _CFXRegistrationPost ()
      #15    0x00000001a4324bb8 in _CFXNotificationPost ()
      #16    0x00000001a31b2574 in -[NSNotificationCenter postNotificationName:object:userInfo:] ()
      #17    0x00000001a6943270 in -[UIInputWindowController postNotificationName:userInfo:] ()
      #18    0x00000001a6942ce8 in __68-[UIInputWindowController postValidatedStartNotifications:withInfo:]_block_invoke ()
      #19    0x00000001a687e5b8 in -[UIInputWindowController postValidatedStartNotifications:withInfo:] ()
      #20    0x00000001a687e304 in -[UIInputWindowController postStartNotifications:withInfo:] ()
      #21    0x00000001a66c85a8 in __77-[UIInputWindowController moveFromPlacement:toPlacement:starting:completion:]_block_invoke.510 ()
      #22    0x00000001a65e7be4 in +[UIView(UIViewAnimationWithBlocksPrivate) _modifyAnimationsWithPreferredFrameRateRange:updateReason:animations:] ()
      #23    0x00000001a65e5160 in +[UIView _setupAnimationWithDuration:delay:view:options:factory:animations:start:animationStateGenerator:completion:] ()
      #24    0x00000001a69417a8 in -[UIInputViewAnimationStyle launchAnimation:afterStarted:completion:forHost:fromCurrentPosition:] ()
      #25    0x00000001a6941638 in __77-[UIInputWindowController moveFromPlacement:toPlacement:starting:completion:]_block_invoke.538 ()
      #26    0x00000001a6940fe4 in -[UIInputWindowController chainPlacementsIfNecessaryFrom:toPlacement:transition:completion:] ()
      #27    0x00000001a676eae8 in -[UIInputWindowController moveFromPlacement:toPlacement:starting:completion:] ()
      #28    0x00000001a687b254 in -[UIInputWindowController setInputViewSet:] ()
      #29    0x00000001a687abac in -[UIInputWindowController performOperations:withAnimationStyle:] ()
      #30    0x00000001a66c416c in -[UIKeyboardSceneDelegate setKeyWindowSceneInputViews:animationStyle:] ()
      #31    0x00000001a687bbe4 in -[UIKeyboardSceneDelegate setInputViews:animationStyle:] ()
      #32    0x00000001a687bb30 in -[UIKeyboardSceneDelegate setInputViews:animated:] ()
      #33    0x00000001a687bac0 in -[UIKeyboardSceneDelegate setInputViews:] ()
      #34    0x00000001a681d3e0 in __102-[UIKeyboardSceneDelegate _reloadInputViewsForKeyWindowSceneResponder:force:fromBecomeFirstResponder:]_block_invoke.502 ()
      #35    0x00000001a681b98c in -[UIKeyboardSceneDelegate _reloadInputViewsForKeyWindowSceneResponder:force:fromBecomeFirstResponder:] ()
      #36    0x00000001a687bd3c in -[UIKeyboardSceneDelegate _reloadInputViewsForResponder:force:fromBecomeFirstResponder:] ()
      #37    0x00000001a68bb310 in -[UIResponder(UIResponderInputViewAdditions) _reloadInputViewsFromFirstResponder:] ()
      #38    0x00000001a68ba680 in -[UIResponder becomeFirstResponder] ()
      #39    0x00000001a685cee4 in -[UIView(Hierarchy) becomeFirstResponder] ()
      #40    0x00000001013d16d8 in -[QUIView becomeFirstResponder] at /Users/qt/work/qt/qtbase/src/plugins/platforms/ios/quiview.mm:281
      #41    0x00000001a68ba3b8 in -[UIResponder resignFirstResponder] ()
      #42    0x00000001013dac50 in -[QIOSTextInputResponder resignFirstResponder] at /Users/qt/work/qt/qtbase/src/plugins/platforms/ios/qiostextresponder.mm:335
      #43    0x00000001013c9140 in -[QIOSKeyboardListener gestureStateChanged:] at /Users/qt/work/qt/qtbase/src/plugins/platforms/ios/qiosinputcontext.mm:269
      #44    0x00000001a6980e7c in -[UIGestureRecognizerTarget _sendActionWithGestureRecognizer:] ()
      #45    0x00000001a6980cec in _UIGestureRecognizerSendTargetActions ()
      #46    0x00000001a6980aac in _UIGestureRecognizerSendActions ()
      #47    0x00000001a66129d0 in -[UIGestureRecognizer _updateGestureForActiveEvents] ()
      #48    0x00000001a65e011c in _UIGestureEnvironmentUpdate ()
      #49    0x00000001a66dbbc0 in -[UIGestureEnvironment _deliverEvent:toGestureRecognizers:usingBlock:] ()
      #50    0x00000001a6892680 in -[UIGestureEnvironment _updateForEvent:window:] ()
      #51    0x00000001a6891944 in -[UIWindow sendEvent:] ()
      #52    0x00000001013bb9bc in -[QUIWindow sendEvent:] at /Users/qt/work/qt/qtbase/src/plugins/platforms/ios/qiosscreen.mm:208
      #53    0x00000001a67129e0 in -[UIApplication sendEvent:] ()
      #54    0x00000001a67141d4 in __dispatchPreprocessedEventFromEventQueue ()
      #55    0x00000001a671cecc in __processEventQueue ()
      #56    0x00000001a660f84c in updateCycleEntry ()
      #57    0x00000001a660d76c in _UIUpdateSequenceRun ()
      #58    0x00000001a660d3b0 in schedulerStepScheduledMainSection ()
      #59    0x00000001a660e254 in runloopSourceCallback ()
      #60    0x00000001a432b834 in __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ ()
      #61    0x00000001a432b7c8 in __CFRunLoopDoSource0 ()
      #62    0x00000001a4329298 in __CFRunLoopDoSources0 ()
      #63    0x00000001a4328484 in __CFRunLoopRun ()
      #64    0x00000001a4327cd8 in CFRunLoopRunSpecific ()
      #65    0x00000001e91d81a8 in GSEventRunModal ()
      #66    0x00000001a696090c in -[UIApplication _run] ()
      #67    0x00000001a6a149d0 in UIApplicationMain ()
      #68    0x00000001013b4eac in qt_main_wrapper at /Users/qt/work/qt/qtbase/src/plugins/platforms/ios/qioseventdispatcher.mm:242
      #69    0x00000001c79d9e4c in start ()
       

      Looks like the keyboard started closes here (file qiosinputcontext.mm)

      - (void)gestureStateChanged:(id)sender
      {
          Q_UNUSED(sender);
      
      
          if (self.state == UIGestureRecognizerStateBegan) {
              qImDebug("hide keyboard gesture was triggered");
              UIResponder *firstResponder = [UIResponder currentFirstResponder];
              Q_ASSERT([firstResponder isKindOfClass:[QIOSTextInputResponder class]]);
              [firstResponder resignFirstResponder]; // keyboard closes here
          }
      } 

       

      The question is, Is it possible to change this behavior so that the keyboard does not close?

      Attachments

        1. RPReplay_Final1722533457.mov
          862 kB
        2. main.qml
          0.3 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            vestbo Tor Arne Vestbø
            freed Igor Bugaev
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes