mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 06:35:51 +00:00
Fix reaction search bar click through
This commit is contained in:
@@ -267,6 +267,8 @@ final class EmojiSearchSearchBarComponent: Component {
|
||||
private var highlightedItem: AnyHashable?
|
||||
private var selectedItem: AnyHashable?
|
||||
|
||||
private var disableInteraction: Bool = false
|
||||
|
||||
private lazy var hapticFeedback: HapticFeedback = {
|
||||
return HapticFeedback()
|
||||
}()
|
||||
@@ -421,10 +423,16 @@ final class EmojiSearchSearchBarComponent: Component {
|
||||
}
|
||||
|
||||
override func hitTest(_ point: CGPoint, with event: UIEvent?) -> UIView? {
|
||||
guard let component = self.component else {
|
||||
if self.disableInteraction {
|
||||
for (_, itemView) in self.visibleItemViews {
|
||||
if let itemComponentView = itemView.view.view {
|
||||
if itemComponentView.bounds.contains(self.convert(point, to: itemComponentView)) {
|
||||
return self
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
let _ = component
|
||||
|
||||
return super.hitTest(point, with: event)
|
||||
}
|
||||
@@ -714,10 +722,17 @@ final class EmojiSearchSearchBarComponent: Component {
|
||||
|
||||
switch component.textInputState {
|
||||
case let .active(hasText):
|
||||
self.isUserInteractionEnabled = false
|
||||
if hasText {
|
||||
self.disableInteraction = false
|
||||
self.isUserInteractionEnabled = false
|
||||
} else {
|
||||
self.disableInteraction = true
|
||||
self.isUserInteractionEnabled = true
|
||||
}
|
||||
self.textView.view?.isHidden = hasText
|
||||
self.tintTextView.view?.isHidden = hasText
|
||||
case .inactive:
|
||||
self.disableInteraction = false
|
||||
self.isUserInteractionEnabled = true
|
||||
self.textView.view?.isHidden = false
|
||||
self.tintTextView.view?.isHidden = false
|
||||
|
||||
Reference in New Issue
Block a user