mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 22:25:57 +00:00
Various improvements
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user