added logic for added/removing the accessibilityTrait .notEnabled based off the dissbled state
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
parent
1b292531ed
commit
bc6c783e4e
@ -270,6 +270,11 @@ open class SelectorItemBase<Selector: SelectorControlable>: Control, Errorable,
|
||||
}
|
||||
|
||||
open override func updateAccessibilityLabel() {
|
||||
if !accessibilityTraits.contains(.notEnabled) && disabled {
|
||||
accessibilityTraits.insert(.notEnabled)
|
||||
} else {
|
||||
accessibilityTraits.remove(.notEnabled)
|
||||
}
|
||||
setAccessibilityLabel(for: [label, childLabel, errorLabel])
|
||||
}
|
||||
}
|
||||
|
||||
@ -138,7 +138,6 @@ open class ButtonBase: UIButton, Buttonable, Handlerable, ViewProtocol, Resettab
|
||||
}
|
||||
|
||||
open func setup() {
|
||||
|
||||
translatesAutoresizingMaskIntoConstraints = false
|
||||
|
||||
titleLabel?.adjustsFontSizeToFitWidth = false
|
||||
@ -172,7 +171,11 @@ open class ButtonBase: UIButton, Buttonable, Handlerable, ViewProtocol, Resettab
|
||||
}
|
||||
|
||||
open func updateAccessibilityLabel() {
|
||||
|
||||
if !accessibilityTraits.contains(.notEnabled) && disabled {
|
||||
accessibilityTraits.insert(.notEnabled)
|
||||
} else {
|
||||
accessibilityTraits.remove(.notEnabled)
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------
|
||||
|
||||
@ -76,6 +76,7 @@ open class TextLinkCaret: ButtonBase {
|
||||
//--------------------------------------------------
|
||||
open override func setup() {
|
||||
super.setup()
|
||||
accessibilityTraits = .link
|
||||
}
|
||||
|
||||
open override func reset() {
|
||||
|
||||
@ -248,6 +248,11 @@ open class RadioBoxItem: Control, Changeable {
|
||||
}
|
||||
|
||||
open override func updateAccessibilityLabel() {
|
||||
if !accessibilityTraits.contains(.notEnabled) && disabled {
|
||||
accessibilityTraits.insert(.notEnabled)
|
||||
} else {
|
||||
accessibilityTraits.remove(.notEnabled)
|
||||
}
|
||||
setAccessibilityLabel(for: [textLabel, subTextLabel, subTextRightLabel])
|
||||
}
|
||||
|
||||
|
||||
@ -182,7 +182,6 @@ open class EntryField: Control, Changeable {
|
||||
super.setup()
|
||||
|
||||
isAccessibilityElement = true
|
||||
accessibilityTraits = .button
|
||||
addSubview(stackView)
|
||||
|
||||
//create the wrapping view
|
||||
|
||||
@ -312,6 +312,11 @@ open class Toggle: Control, Changeable {
|
||||
}
|
||||
|
||||
open override func updateAccessibilityLabel() {
|
||||
if !accessibilityTraits.contains(.notEnabled) && disabled {
|
||||
accessibilityTraits.insert(.notEnabled)
|
||||
} else {
|
||||
accessibilityTraits.remove(.notEnabled)
|
||||
}
|
||||
setAccessibilityLabel(for: [label])
|
||||
}
|
||||
}
|
||||
|
||||
@ -53,9 +53,9 @@ open class Tooltip: Control, TooltipLaunchable {
|
||||
open var title: String? { didSet { setNeedsUpdate() }}
|
||||
|
||||
open var content: String? { didSet { setNeedsUpdate() }}
|
||||
|
||||
|
||||
open var contentView: UIView? { didSet { setNeedsUpdate() }}
|
||||
|
||||
|
||||
//--------------------------------------------------
|
||||
// MARK: - Configuration
|
||||
//--------------------------------------------------
|
||||
@ -87,7 +87,7 @@ open class Tooltip: Control, TooltipLaunchable {
|
||||
$0.setSurfaceColors(VDSColor.elementsBrandhighlight, VDSColor.elementsBrandhighlight, forState: .normal)
|
||||
$0.setSurfaceColors(VDSColor.elementsBrandhighlight, VDSColor.elementsBrandhighlight, forState: .highlighted)
|
||||
$0.setSurfaceColors(VDSColor.interactiveDisabledOnlight, VDSColor.interactiveDisabledOndark, forState: .disabled)
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------
|
||||
// MARK: - Initializers
|
||||
@ -163,6 +163,14 @@ open class Tooltip: Control, TooltipLaunchable {
|
||||
//get the color for the image
|
||||
let imageColor = iconColorConfiguration.getColor(self)
|
||||
imageView.image = infoImage.withTintColor(imageColor)
|
||||
}
|
||||
|
||||
open override func updateAccessibilityLabel() {
|
||||
if !accessibilityTraits.contains(.notEnabled) && disabled {
|
||||
accessibilityTraits.insert(.notEnabled)
|
||||
} else {
|
||||
accessibilityTraits.remove(.notEnabled)
|
||||
}
|
||||
var label = title
|
||||
if label == nil {
|
||||
label = content
|
||||
@ -171,9 +179,9 @@ open class Tooltip: Control, TooltipLaunchable {
|
||||
accessibilityLabel = "Tooltip: \(label)"
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
// MARK: AppleGuidlinesTouchable
|
||||
extension Tooltip: AppleGuidlinesTouchable {
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user