mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 22:55:00 +00:00
Fix button interactions
This commit is contained in:
@@ -109,8 +109,11 @@ public final class ComponentHostView<EnvironmentType>: UIView {
|
|||||||
if self.alpha.isZero {
|
if self.alpha.isZero {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
if !self.isUserInteractionEnabled {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
for view in self.subviews.reversed() {
|
for view in self.subviews.reversed() {
|
||||||
if let result = view.hitTest(self.convert(point, to: view), with: event), result.isUserInteractionEnabled {
|
if view.isUserInteractionEnabled, view.alpha != 0.0, let result = view.hitTest(self.convert(point, to: view), with: event) {
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -48,7 +48,6 @@ public final class AudioTranscriptionButtonComponent: Component {
|
|||||||
override init(frame: CGRect) {
|
override init(frame: CGRect) {
|
||||||
self.backgroundLayer = SimpleLayer()
|
self.backgroundLayer = SimpleLayer()
|
||||||
self.animationView = ComponentHostView<Empty>()
|
self.animationView = ComponentHostView<Empty>()
|
||||||
self.animationView.isUserInteractionEnabled = false
|
|
||||||
|
|
||||||
super.init(frame: frame)
|
super.init(frame: frame)
|
||||||
|
|
||||||
@@ -56,6 +55,8 @@ public final class AudioTranscriptionButtonComponent: Component {
|
|||||||
self.backgroundLayer.cornerRadius = 10.0
|
self.backgroundLayer.cornerRadius = 10.0
|
||||||
self.layer.addSublayer(self.backgroundLayer)
|
self.layer.addSublayer(self.backgroundLayer)
|
||||||
|
|
||||||
|
self.animationView.isUserInteractionEnabled = false
|
||||||
|
|
||||||
self.addSubview(self.animationView)
|
self.addSubview(self.animationView)
|
||||||
|
|
||||||
self.addTarget(self, action: #selector(self.pressed), for: .touchUpInside)
|
self.addTarget(self, action: #selector(self.pressed), for: .touchUpInside)
|
||||||
|
|||||||
Reference in New Issue
Block a user