flipped off by default but only set if "touchUpInside" publisher is set

Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
Matt Bruce 2023-01-11 11:26:12 -06:00
parent c6ffa5736d
commit 04a5fddf48
2 changed files with 7 additions and 1 deletions

View File

@ -29,7 +29,7 @@ open class Control: UIControl, Handlerable, ViewProtocol, Resettable {
open override var isSelected: Bool { didSet { didChange() } }
internal var enabledHighlight: Bool = true
internal var enabledHighlight: Bool = false
var isHighlightAnimating = false
open override var isHighlighted: Bool {

View File

@ -17,6 +17,12 @@ public final class UIControlSubscription<SubscriberType: Subscriber, Control: UI
public init(subscriber: SubscriberType, control: Control, event: UIControl.Event) {
self.subscriber = subscriber
self.control = control
//allow highlight for VDS.Controls on "onClick" events
if let c = control as? VDS.Control, event == .touchUpInside {
c.enabledHighlight = true
}
control.addTarget(self, action: #selector(eventHandler), for: event)
}