mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 14:45:21 +00:00
Web app improvements
This commit is contained in:
@@ -131,9 +131,7 @@ final class WebAppWebView: WKWebView {
|
||||
}
|
||||
|
||||
private(set) var didTouchOnce = false
|
||||
@objc func handleTap() {
|
||||
self.didTouchOnce = true
|
||||
}
|
||||
var onFirstTouch: () -> Void = {}
|
||||
|
||||
func scrollToActiveElement(layout: ContainerViewLayout, completion: @escaping (CGPoint) -> Void, transition: ContainedViewLayoutTransition) {
|
||||
self.evaluateJavaScript(findActiveElementY, completionHandler: { result, _ in
|
||||
@@ -159,6 +157,15 @@ final class WebAppWebView: WKWebView {
|
||||
})
|
||||
}
|
||||
|
||||
override func hitTest(_ point: CGPoint, with event: UIEvent?) -> UIView? {
|
||||
let result = super.hitTest(point, with: event)
|
||||
if result != nil && !self.didTouchOnce {
|
||||
self.didTouchOnce = true
|
||||
self.onFirstTouch()
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
override var inputAccessoryView: UIView? {
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user