Poll creation

This commit is contained in:
Isaac
2024-04-12 21:55:06 +04:00
parent c7035b2621
commit 844f2c71c3
10 changed files with 1775 additions and 263 deletions

View File

@@ -114,6 +114,7 @@ public final class TextFieldComponent: Component {
public let present: (ViewController) -> Void
public let paste: (PasteData) -> Void
public let returnKeyAction: (() -> Void)?
public let backspaceKeyAction: (() -> Void)?
public init(
context: AccountContext,
@@ -134,7 +135,8 @@ public final class TextFieldComponent: Component {
lockedFormatAction: @escaping () -> Void,
present: @escaping (ViewController) -> Void,
paste: @escaping (PasteData) -> Void,
returnKeyAction: (() -> Void)? = nil
returnKeyAction: (() -> Void)? = nil,
backspaceKeyAction: (() -> Void)? = nil
) {
self.context = context
self.theme = theme
@@ -155,6 +157,7 @@ public final class TextFieldComponent: Component {
self.present = present
self.paste = paste
self.returnKeyAction = returnKeyAction
self.backspaceKeyAction = backspaceKeyAction
}
public static func ==(lhs: TextFieldComponent, rhs: TextFieldComponent) -> Bool {
@@ -463,6 +466,10 @@ public final class TextFieldComponent: Component {
}
public func chatInputTextNodeBackspaceWhileEmpty() {
guard let component = self.component else {
return
}
component.backspaceKeyAction?()
}
@available(iOS 13.0, *)