Web app improvements

This commit is contained in:
Ilya Laktyushin 2024-06-29 01:34:03 +04:00
parent 9146416f68
commit 0a08c0908b
3 changed files with 11 additions and 5 deletions

View File

@ -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

View File

@ -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)

View File

@ -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)