mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-08-02 00:17:02 +00:00
Reuse dismissInput when closing keyboard with a gesture
This commit is contained in:
parent
db4aa60e6e
commit
89da2e7a3d
@ -2021,14 +2021,7 @@ class ChatControllerNode: ASDisplayNode, UIScrollViewDelegate {
|
|||||||
|
|
||||||
if canDismiss, let inputHeight = derivedLayoutState.inputNodeHeight, currentLocation.y + (self.keyboardGestureAccessoryHeight ?? 0.0) > validLayout.size.height - inputHeight {
|
if canDismiss, let inputHeight = derivedLayoutState.inputNodeHeight, currentLocation.y + (self.keyboardGestureAccessoryHeight ?? 0.0) > validLayout.size.height - inputHeight {
|
||||||
self.upperInputPositionBound = nil
|
self.upperInputPositionBound = nil
|
||||||
self.requestUpdateInterfaceState(.animated(duration: 0.25, curve: .spring), true, { state in
|
self.dismissInput()
|
||||||
if case .none = state.inputMode {
|
|
||||||
return state
|
|
||||||
}
|
|
||||||
return state.updatedInputMode { _ in
|
|
||||||
return .none
|
|
||||||
}
|
|
||||||
})
|
|
||||||
} else {
|
} else {
|
||||||
self.upperInputPositionBound = nil
|
self.upperInputPositionBound = nil
|
||||||
self.updateLayoutInternal(transition: .animated(duration: 0.25, curve: .spring))
|
self.updateLayoutInternal(transition: .animated(duration: 0.25, curve: .spring))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user