Various improvements

This commit is contained in:
Ilya Laktyushin
2025-04-16 13:54:14 +04:00
parent 1f051f737a
commit a43e5fc16b
23 changed files with 1617 additions and 632 deletions

View File

@@ -2145,6 +2145,8 @@ public protocol ContextReferenceContentSource: AnyObject {
var shouldBeDismissed: Signal<Bool, NoError> { get }
var forceDisplayBelowKeyboard: Bool { get }
func transitionInfo() -> ContextControllerReferenceViewInfo?
}
@@ -2153,6 +2155,10 @@ public extension ContextReferenceContentSource {
return false
}
var forceDisplayBelowKeyboard: Bool {
return false
}
var shouldBeDismissed: Signal<Bool, NoError> {
return .single(false)
}
@@ -2744,7 +2750,9 @@ public final class ContextController: ViewController, StandalonePresentableContr
}
public func dismiss(result: ContextMenuActionResult, completion: (() -> Void)?) {
if viewTreeContainsFirstResponder(view: self.view) {
if let mainSource = self.configuration.sources.first(where: { $0.id == self.configuration.initialId }), case let .reference(source) = mainSource.source, source.forceDisplayBelowKeyboard {
} else if viewTreeContainsFirstResponder(view: self.view) {
self.dismissOnInputClose = (result, completion)
self.view.endEditing(true)
return