mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-10-09 03:20:48 +00:00
Fix bot keyboard not showing up if text field is focused
This commit is contained in:
parent
7c1f5b9b84
commit
76359a526e
@ -2508,7 +2508,9 @@ class ChatControllerNode: ASDisplayNode, UIScrollViewDelegate {
|
||||
} else {
|
||||
if let inputPanelNode = self.inputPanelNode as? ChatTextInputPanelNode {
|
||||
if inputPanelNode.isFocused {
|
||||
inputPanelNode.skipPresentationInterfaceStateUpdate = true
|
||||
self.context.sharedContext.mainWindow?.simulateKeyboardDismiss(transition: .animated(duration: 0.5, curve: .spring))
|
||||
inputPanelNode.skipPresentationInterfaceStateUpdate = false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3235,12 +3235,13 @@ class ChatTextInputPanelNode: ChatInputPanelNode, ASEditableTextNodeDelegate {
|
||||
self.inputMenu.activate()
|
||||
}
|
||||
|
||||
var skipPresentationInterfaceStateUpdate = false
|
||||
func editableTextNodeDidFinishEditing(_ editableTextNode: ASEditableTextNode) {
|
||||
self.storedInputLanguage = editableTextNode.textInputMode.primaryLanguage
|
||||
self.inputMenu.deactivate()
|
||||
self.dismissedEmojiSuggestionPosition = nil
|
||||
|
||||
if let presentationInterfaceState = self.presentationInterfaceState {
|
||||
if let presentationInterfaceState = self.presentationInterfaceState, !self.skipPresentationInterfaceStateUpdate {
|
||||
if let peer = presentationInterfaceState.renderedPeer?.peer as? TelegramUser, peer.botInfo != nil, let keyboardButtonsMessage = presentationInterfaceState.keyboardButtonsMessage, let keyboardMarkup = keyboardButtonsMessage.visibleButtonKeyboardMarkup, keyboardMarkup.flags.contains(.persistent) {
|
||||
self.interfaceInteraction?.updateInputModeAndDismissedButtonKeyboardMessageId { _ in
|
||||
return (.inputButtons(persistent: true), nil)
|
||||
|
Loading…
x
Reference in New Issue
Block a user