diff --git a/submodules/AsyncDisplayKit/Source/ASEditableTextNode.mm b/submodules/AsyncDisplayKit/Source/ASEditableTextNode.mm index 984e293e31..4e7f6c3935 100644 --- a/submodules/AsyncDisplayKit/Source/ASEditableTextNode.mm +++ b/submodules/AsyncDisplayKit/Source/ASEditableTextNode.mm @@ -114,7 +114,28 @@ } - (void)setContentSize:(CGSize)contentSize { - [super setContentSize:contentSize]; + if (_shouldBlockPanGesture) { + return; + } + [super setContentSize:contentSize]; +} + +- (void)setContentOffset:(CGPoint)contentOffset { + if (_shouldBlockPanGesture) { + return; + } + [super setContentOffset:contentOffset]; +} + +- (void)setContentOffset:(CGPoint)contentOffset animated:(BOOL)animated { + if (_shouldBlockPanGesture) { + return; + } + [super setContentOffset:contentOffset animated:animated]; +} + +- (void)setBounds:(CGRect)bounds { + [super setBounds:bounds]; } - (BOOL)canPerformAction:(SEL)action withSender:(id)sender diff --git a/submodules/ChatListUI/Sources/Node/ChatListItem.swift b/submodules/ChatListUI/Sources/Node/ChatListItem.swift index 6e1ab4d3f7..790288bb53 100644 --- a/submodules/ChatListUI/Sources/Node/ChatListItem.swift +++ b/submodules/ChatListUI/Sources/Node/ChatListItem.swift @@ -1867,6 +1867,9 @@ class ChatListItemNode: ItemListRevealOptionsItemNode { transition.animatePosition(node: strongSelf.titleNode, from: CGPoint(x: titlePosition.x - contentDelta.x, y: titlePosition.y - contentDelta.y)) transition.animatePositionAdditive(node: strongSelf.textNode, offset: CGPoint(x: -contentDelta.x, y: -contentDelta.y)) + if let dustNode = strongSelf.dustNode { + transition.animatePositionAdditive(node: dustNode, offset: CGPoint(x: -contentDelta.x, y: -contentDelta.y)) + } let authorPosition = strongSelf.authorNode.position transition.animatePosition(node: strongSelf.authorNode, from: CGPoint(x: authorPosition.x - contentDelta.x, y: authorPosition.y - contentDelta.y)) diff --git a/submodules/TelegramUI/Sources/ChatTextInputPanelNode.swift b/submodules/TelegramUI/Sources/ChatTextInputPanelNode.swift index 2c629d71cd..3bef46b634 100644 --- a/submodules/TelegramUI/Sources/ChatTextInputPanelNode.swift +++ b/submodules/TelegramUI/Sources/ChatTextInputPanelNode.swift @@ -1908,6 +1908,8 @@ class ChatTextInputPanelNode: ChatInputPanelNode, ASEditableTextNodeDelegate { let accentTextColor = presentationInterfaceState.theme.chat.inputPanel.panelControlAccentColor let baseFontSize = max(minInputFontSize, presentationInterfaceState.fontSize.baseDisplaySize) + textInputNode.textView.isScrollEnabled = false + refreshChatTextInputAttributes(textInputNode, theme: presentationInterfaceState.theme, baseFontSize: baseFontSize, spoilersRevealed: self.spoilersRevealed) textInputNode.attributedText = textAttributedStringForStateText(self.inputTextState.inputText, fontSize: baseFontSize, textColor: textColor, accentTextColor: accentTextColor, writingDirection: nil, spoilersRevealed: self.spoilersRevealed) @@ -1916,15 +1918,23 @@ class ChatTextInputPanelNode: ChatInputPanelNode, ASEditableTextNodeDelegate { let containerView = textInputNode.textView.subviews[1] if let canvasView = containerView.subviews.first { if let snapshotView = canvasView.snapshotView(afterScreenUpdates: false) { + snapshotView.frame = canvasView.frame.offsetBy(dx: 0.0, dy: -textInputNode.textView.contentOffset.y) textInputNode.view.insertSubview(snapshotView, at: 0) canvasView.layer.animateAlpha(from: 0.0, to: 1.0, duration: 0.3) - snapshotView.layer.animateAlpha(from: 1.0, to: 0.0, duration: 0.3, removeOnCompletion: false, completion: { [weak snapshotView] _ in + snapshotView.layer.animateAlpha(from: 1.0, to: 0.0, duration: 0.3, removeOnCompletion: false, completion: { [weak snapshotView, weak textInputNode] _ in + textInputNode?.textView.isScrollEnabled = false snapshotView?.removeFromSuperview() + Queue.mainQueue().after(0.1) { + textInputNode?.textView.isScrollEnabled = true + } }) } } } - + Queue.mainQueue().after(0.1) { + textInputNode.textView.isScrollEnabled = true + } + if animated { if revealed { let transition = ContainedViewLayoutTransition.animated(duration: 0.3, curve: .linear)