Open chauhan130 opened 2 years ago
Experiencing this issue too. Did you find any workaround?
@IAmConorNolan, as a temporary workaround, before presenting the alert controller, I do view.endEditing(true)
, also overrode canBecomeFirstResponder
of the viewController and return true only if the current view controller is at the top, like there is no any view controller presented and the in the navigation stack, it is the front most view controller.
@IAmConorNolan @chauhan130 Experiencing the same issue. Also the inputAccessoryView appears slower than the animation of the view controller itself. Is it like completely broken in IOS 16?
@ekazaev +1, I'm also experiencing this same lag when transitioning to a view controller showing the inputBarAccessoryView.
I think this is an issue MessageKit would have to address. InputBarAccessoryView doesnt track the UIViewController its attached to.
MessagesViewController should probably not be the first responder if its presenting another UIViewController.
As a workaround, you could override its canBecomeFirstResponder
and ensure you resignFirstResponder
before presenting
Having the same issue. @nathantannar4 is there a more robust fix now or should we still use the workarounds?
Seems like iOS 16's deprecating of UIRemoteKeyboardWindow is causing this issue. The code below works great. presentedViewController covers UIAlertController as well as any UIViewController with modalPresentationStyle that's not full screen. Hope this helps anyone else with this issue.
override var canBecomeFirstResponder: Bool{
if #available(iOS 16, *) {
// UIRemoteKeyboardWindow was deprecated in iOS 16 and caused new behavior.
// Fixes bug where inputAccessoryView displays above actionsheet or panel.
print("canBecomeFirstResponder: \(!isInputBarHidden && presentedViewController == nil)")
return preIOS16CanBecomeFirstResponderFlag && presentedViewController == nil
}
else {
return preIOS16CanBecomeFirstResponderFlag
}
}
@JCsplash what if I don't own this view controller (inner ads view controllers)?
Describe the bug The inputBarAccessoryView is shown along with the UIAlertController, when presented as
.actionSheet
, works fine for.alert
.To Reproduce Steps/code to reproduce the behavior:
Expected behavior The keyboard is hidden and the action sheet is presented.
Screenshots
Environment
Additional context Add any other context about the problem here. The issue happens with iOS 16 only. Works fine with the latest iOS 15.