diff --git a/submodules/AttachmentUI/Sources/AttachmentContainer.swift b/submodules/AttachmentUI/Sources/AttachmentContainer.swift index 0a36720815..6154933932 100644 --- a/submodules/AttachmentUI/Sources/AttachmentContainer.swift +++ b/submodules/AttachmentUI/Sources/AttachmentContainer.swift @@ -157,10 +157,6 @@ final class AttachmentContainer: ASDisplayNode, ASGestureRecognizerDelegate { } if let view = otherGestureRecognizer.view, view.description.contains("WKChildScroll") { return false -// let velocity = panGestureRecognizer.velocity(in: nil) -// if abs(velocity.x) > abs(velocity.y) * 2.0 { -// return false -// } } if let _ = otherGestureRecognizer.view?.asyncdisplaykit_node as? CollectionIndexNode { return false @@ -222,7 +218,7 @@ final class AttachmentContainer: ASDisplayNode, ASGestureRecognizerDelegate { let currentHitView = self.hitTest(point, with: nil) var scrollViewAndListNode = self.findScrollView(view: currentHitView) - if scrollViewAndListNode?.0.frame.height == self.frame.width { + if scrollViewAndListNode?.0.frame.height == self.frame.width || scrollViewAndListNode?.0.isDescendant(of: self.view) == false { scrollViewAndListNode = nil } let scrollView = scrollViewAndListNode?.0 diff --git a/submodules/Display/Source/Navigation/NavigationContainer.swift b/submodules/Display/Source/Navigation/NavigationContainer.swift index c07d352f34..d19431465f 100644 --- a/submodules/Display/Source/Navigation/NavigationContainer.swift +++ b/submodules/Display/Source/Navigation/NavigationContainer.swift @@ -77,6 +77,8 @@ public final class NavigationContainer: ASDisplayNode, ASGestureRecognizerDelega public private(set) var controllers: [ViewController] = [] private var state: State = State(layout: nil, canBeClosed: nil, top: nil, transition: nil, pending: nil) + weak var minimizedContainer: MinimizedContainer? + private var ignoreInputHeight: Bool = false public private(set) var isReady: Bool = false @@ -235,6 +237,13 @@ public final class NavigationContainer: ASDisplayNode, ASGestureRecognizerDelega let topNode = topController.displayNode var bottomControllerLayout = layout if bottomController.view.disableAutomaticKeyboardHandling.isEmpty { + if let minimizedContainer = self.minimizedContainer, (bottomControllerLayout.inputHeight ?? 0.0) > 0.0 { + var updatedSize = bottomControllerLayout.size + var updatedIntrinsicInsets = bottomControllerLayout.intrinsicInsets + updatedSize.height -= minimizedContainer.collapsedHeight(layout: layout) + updatedIntrinsicInsets.bottom = 0.0 + bottomControllerLayout = bottomControllerLayout.withUpdatedSize(updatedSize).withUpdatedIntrinsicInsets(updatedIntrinsicInsets) + } bottomControllerLayout = bottomControllerLayout.withUpdatedInputHeight(nil) } bottomController.containerLayoutUpdated(bottomControllerLayout, transition: .immediate) diff --git a/submodules/Display/Source/Navigation/NavigationController.swift b/submodules/Display/Source/Navigation/NavigationController.swift index 5e7a82697e..45d9f2f300 100644 --- a/submodules/Display/Source/Navigation/NavigationController.swift +++ b/submodules/Display/Source/Navigation/NavigationController.swift @@ -873,6 +873,7 @@ open class NavigationController: UINavigationController, ContainableController, let updatedLayout = layout.withUpdatedSize(updatedSize).withUpdatedIntrinsicInsets(updatedIntrinsicInsets) transition.updateFrame(node: flatContainer, frame: CGRect(origin: CGPoint(), size: updatedSize)) flatContainer.update(layout: updatedLayout, canBeClosed: false, controllers: controllers, transition: transition) + flatContainer.minimizedContainer = self.minimizedContainer case let .split(splitContainer): let flatContainer = NavigationContainer(isFlat: self.isFlat, controllerRemoved: { [weak self] controller in self?.controllerRemoved(controller)