Merge branch 'mbruce/bugfix' into 'develop'
Bugfixes See merge request BPHV_MIPS/vds_ios!218
This commit is contained in:
commit
b6a51ebb9c
@ -1377,7 +1377,7 @@
|
||||
BUILD_LIBRARY_FOR_DISTRIBUTION = YES;
|
||||
CODE_SIGN_IDENTITY = "";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
CURRENT_PROJECT_VERSION = 59;
|
||||
CURRENT_PROJECT_VERSION = 60;
|
||||
DEFINES_MODULE = YES;
|
||||
DEVELOPMENT_TEAM = "";
|
||||
DYLIB_COMPATIBILITY_VERSION = 1;
|
||||
@ -1414,7 +1414,7 @@
|
||||
BUILD_LIBRARY_FOR_DISTRIBUTION = YES;
|
||||
CODE_SIGN_IDENTITY = "";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
CURRENT_PROJECT_VERSION = 59;
|
||||
CURRENT_PROJECT_VERSION = 60;
|
||||
DEFINES_MODULE = YES;
|
||||
DEVELOPMENT_TEAM = "";
|
||||
DYLIB_COMPATIBILITY_VERSION = 1;
|
||||
|
||||
@ -114,9 +114,16 @@ open class SelectorBase: Control, SelectorControlable {
|
||||
accessibilityTraits = .button
|
||||
}
|
||||
|
||||
open override func updateView() {
|
||||
super.updateView()
|
||||
setNeedsLayout()
|
||||
layoutIfNeeded()
|
||||
}
|
||||
|
||||
/// Used to update any Accessibility properties.ß
|
||||
open override func updateAccessibility() {
|
||||
super.updateAccessibility()
|
||||
accessibilityLabel = "\(Self.self)\(showError ? ", error" : "")"
|
||||
}
|
||||
|
||||
/// This will change the state of the Selector and execute the actionBlock if provided.
|
||||
|
||||
@ -190,7 +190,7 @@ open class SelectorItemBase<Selector: SelectorControlable>: Control, Errorable,
|
||||
/// Used to update any Accessibility properties.
|
||||
open override func updateAccessibility() {
|
||||
super.updateAccessibility()
|
||||
setAccessibilityLabel(for: [label, childLabel, errorLabel])
|
||||
setAccessibilityLabel(for: [selectorView, label, childLabel, errorLabel])
|
||||
}
|
||||
|
||||
/// Resets to default settings.
|
||||
|
||||
@ -42,7 +42,6 @@ open class Checkbox: SelectorBase {
|
||||
/// Called once when a view is initialized and is used to Setup additional UI or other constants and configurations.
|
||||
open override func setup() {
|
||||
super.setup()
|
||||
accessibilityLabel = "Checkbox"
|
||||
|
||||
backgroundColorConfiguration.setSurfaceColors(VDSColor.elementsPrimaryOnlight, VDSColor.elementsPrimaryOndark, forState: .selected)
|
||||
backgroundColorConfiguration.setSurfaceColors(VDSColor.elementsPrimaryOnlight, VDSColor.elementsPrimaryOndark, forState: [.selected, .highlighted])
|
||||
@ -71,7 +70,7 @@ open class Checkbox: SelectorBase {
|
||||
isSelected.toggle()
|
||||
sendActions(for: .valueChanged)
|
||||
}
|
||||
|
||||
|
||||
open override func layoutSubviews() {
|
||||
super.layoutSubviews()
|
||||
|
||||
|
||||
@ -264,8 +264,6 @@ open class Notification: View {
|
||||
isAccessibilityElement = false
|
||||
accessibilityElements = [closeButton, typeIcon, titleLabel, subTitleLabel, buttonGroup]
|
||||
closeButton.accessibilityTraits = [.button]
|
||||
closeButton.accessibilityLabel = "Close Notification"
|
||||
|
||||
}
|
||||
|
||||
/// Resets to default settings.
|
||||
@ -325,7 +323,6 @@ open class Notification: View {
|
||||
let iconColor = surface == .dark ? VDSColor.paletteWhite : VDSColor.paletteBlack
|
||||
typeIcon.name = style.iconName
|
||||
typeIcon.color = iconColor
|
||||
typeIcon.accessibilityLabel = style.accessibilityText
|
||||
closeButton.color = iconColor
|
||||
closeButton.isHidden = hideCloseButton
|
||||
}
|
||||
@ -374,6 +371,12 @@ open class Notification: View {
|
||||
}
|
||||
}
|
||||
|
||||
open override func updateAccessibility() {
|
||||
super.updateAccessibility()
|
||||
closeButton.accessibilityLabel = "Close Notification"
|
||||
typeIcon.accessibilityLabel = style.accessibilityText
|
||||
}
|
||||
|
||||
private func setConstraints() {
|
||||
labelViewAndButtonViewConstraint?.deactivate()
|
||||
labelViewBottomConstraint?.deactivate()
|
||||
|
||||
@ -174,7 +174,7 @@ open class Pagination: View {
|
||||
let isNextAction = sender == nextButton
|
||||
_selectedPageIndex = if isNextAction { _selectedPageIndex + 1 } else { _selectedPageIndex - 1 }
|
||||
updateSelection()
|
||||
DispatchQueue.main.asyncAfter(deadline: .now() + .milliseconds(100)) { [weak self] in
|
||||
DispatchQueue.main.asyncAfter(deadline: .now() + 1) { [weak self] in
|
||||
guard let self else { return }
|
||||
UIAccessibility.post(notification: .announcement, argument: "Page \(self.selectedPage) of \(self.total) selected")
|
||||
}
|
||||
|
||||
@ -78,6 +78,11 @@ open class PaginationButton: ButtonBase {
|
||||
tintColor = color
|
||||
super.updateView()
|
||||
}
|
||||
|
||||
open override func accessibilityActivate() -> Bool {
|
||||
sendActions(for: .touchUpInside)
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
extension PaginationButton {
|
||||
|
||||
@ -49,6 +49,8 @@ open class RadioBoxGroup: SelectorGroupBase<RadioBoxItem>, SelectorGroupSingleSe
|
||||
$0.isEnabled = !model.disabled
|
||||
$0.inputId = model.inputId
|
||||
$0.isSelected = model.selected
|
||||
$0.strikethrough = model.strikethrough
|
||||
$0.strikethroughAccessibilityText = model.strikethroughAccessibileText
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -115,12 +117,14 @@ extension RadioBoxGroup {
|
||||
/// Array of LabelAttributeModel objects used in rendering the subTextRight.
|
||||
public var subTextRightAttributes: [any LabelAttributeModel]?
|
||||
public var selected: Bool
|
||||
public var strikethrough: Bool = false
|
||||
public var strikethroughAccessibileText: String
|
||||
|
||||
public init(disabled: Bool, surface: Surface = .light, inputId: String? = nil, value: AnyHashable? = nil,
|
||||
text: String = "", textAttributes: [any LabelAttributeModel]? = nil,
|
||||
subText: String? = nil, subTextAttributes: [any LabelAttributeModel]? = nil,
|
||||
subTextRight: String? = nil, subTextRightAttributes: [any LabelAttributeModel]? = nil,
|
||||
selected: Bool = false, errorText: String? = nil, accessibileText: String? = nil) {
|
||||
selected: Bool = false, errorText: String? = nil, accessibileText: String? = nil, strikethrough: Bool = false, strikethroughAccessibileText: String = "not available") {
|
||||
self.disabled = disabled
|
||||
self.surface = surface
|
||||
self.inputId = inputId
|
||||
@ -133,6 +137,8 @@ extension RadioBoxGroup {
|
||||
self.subTextRightAttributes = subTextRightAttributes
|
||||
self.selected = selected
|
||||
self.accessibileText = accessibileText
|
||||
self.strikethrough = strikethrough
|
||||
self.strikethroughAccessibileText = strikethroughAccessibileText
|
||||
}
|
||||
|
||||
public init() {
|
||||
|
||||
@ -38,7 +38,7 @@ open class RadioBoxItem: Control, Changeable, FormFieldable {
|
||||
$0.alignment = .top
|
||||
$0.distribution = .fill
|
||||
$0.axis = .horizontal
|
||||
$0.spacing = 12
|
||||
$0.spacing = VDSLayout.space3X
|
||||
}
|
||||
|
||||
private var selectorLeftLabelStackView = UIStackView().with {
|
||||
@ -123,6 +123,8 @@ open class RadioBoxItem: Control, Changeable, FormFieldable {
|
||||
/// If provided, the radio box will be rendered to show the option with a strikethrough.
|
||||
open var strikethrough: Bool = false { didSet { setNeedsUpdate() } }
|
||||
|
||||
open var strikethroughAccessibilityText: String = "not available" { didSet { setNeedsUpdate() } }
|
||||
|
||||
open var inputId: String? { didSet { setNeedsUpdate() } }
|
||||
|
||||
open var value: AnyHashable? { didSet { setNeedsUpdate() } }
|
||||
@ -183,7 +185,7 @@ open class RadioBoxItem: Control, Changeable, FormFieldable {
|
||||
.pinTrailing(0, .defaultHigh)
|
||||
.pinBottom(0, .defaultHigh)
|
||||
|
||||
selectorStackView.pinToSuperView(.uniform(16))
|
||||
selectorStackView.pinToSuperView(.uniform(VDSLayout.space3X))
|
||||
}
|
||||
|
||||
/// Resets to default settings.
|
||||
@ -236,9 +238,8 @@ open class RadioBoxItem: Control, Changeable, FormFieldable {
|
||||
/// Used to update any Accessibility properties.
|
||||
open override func updateAccessibility() {
|
||||
super.updateAccessibility()
|
||||
if accessibilityLabel == nil {
|
||||
setAccessibilityLabel(for: [textLabel, subTextLabel, subTextRightLabel])
|
||||
}
|
||||
setAccessibilityLabel(for: [textLabel, subTextLabel, subTextRightLabel])
|
||||
accessibilityValue = strikethrough ? strikethroughAccessibilityText : nil
|
||||
}
|
||||
|
||||
//--------------------------------------------------
|
||||
|
||||
@ -129,6 +129,7 @@ open class EntryFieldBase: Control, Changeable, FormFieldInternalValidatable {
|
||||
open var errorLabel = Label().with {
|
||||
$0.setContentCompressionResistancePriority(.required, for: .vertical)
|
||||
$0.textStyle = .bodySmall
|
||||
$0.accessibilityValue = "error"
|
||||
}
|
||||
|
||||
open var helperLabel = Label().with {
|
||||
|
||||
@ -151,7 +151,8 @@ open class InputField: EntryFieldBase, UITextFieldDelegate {
|
||||
/// Called once when a view is initialized and is used to Setup additional UI or other constants and configurations.
|
||||
open override func setup() {
|
||||
super.setup()
|
||||
|
||||
isAccessibilityElement = false
|
||||
|
||||
minWidthConstraint = containerView.widthAnchor.constraint(greaterThanOrEqualToConstant: 0)
|
||||
minWidthConstraint?.isActive = true
|
||||
|
||||
@ -272,6 +273,25 @@ open class InputField: EntryFieldBase, UITextFieldDelegate {
|
||||
}
|
||||
}
|
||||
|
||||
/// Used to update any Accessibility properties.
|
||||
open override func updateAccessibility() {
|
||||
super.updateAccessibility()
|
||||
textField.accessibilityLabel = showError ? "error" : nil
|
||||
if showError {
|
||||
accessibilityElements = [titleLabel, textField, icon, errorLabel, helperLabel]
|
||||
} else {
|
||||
accessibilityElements = [titleLabel, textField, helperLabel]
|
||||
}
|
||||
}
|
||||
|
||||
open override var canBecomeFirstResponder: Bool { true }
|
||||
|
||||
open override func resignFirstResponder() -> Bool {
|
||||
if textField.isFirstResponder {
|
||||
textField.resignFirstResponder()
|
||||
}
|
||||
return super.resignFirstResponder()
|
||||
}
|
||||
}
|
||||
|
||||
extension InputField.FieldType {
|
||||
|
||||
@ -239,6 +239,7 @@ open class TextArea: EntryFieldBase {
|
||||
/// Used to update any Accessibility properties.
|
||||
open override func updateAccessibility() {
|
||||
super.updateAccessibility()
|
||||
textView.accessibilityLabel = showError ? "error" : nil
|
||||
if showError {
|
||||
accessibilityElements = [titleLabel, textView, icon, errorLabel, helperLabel]
|
||||
} else {
|
||||
@ -246,6 +247,15 @@ open class TextArea: EntryFieldBase {
|
||||
}
|
||||
}
|
||||
|
||||
open override var canBecomeFirstResponder: Bool { true }
|
||||
|
||||
open override func resignFirstResponder() -> Bool {
|
||||
if textView.isFirstResponder {
|
||||
textView.resignFirstResponder()
|
||||
}
|
||||
return super.resignFirstResponder()
|
||||
}
|
||||
|
||||
//--------------------------------------------------
|
||||
// MARK: - Private Methods
|
||||
//--------------------------------------------------
|
||||
|
||||
@ -147,5 +147,6 @@ open class TextView: UITextView, ViewProtocol {
|
||||
attributedText = nil
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -3,6 +3,10 @@
|
||||
- CXTDT-544442 - Button Icon - Selected state needs to allow custom color
|
||||
- CXTDT-546821 - TextArea - Accessibility - input field is not receiving swipe focus
|
||||
- CXTDT-547200 - Carousel scrollbar – Accessibility - The scrollbar is receiving right/ left swipe focus
|
||||
- CXTDT-549888 - Pagination - Accessibility - Next/Previous
|
||||
- CXTDT-542333 - RadioBox Padding
|
||||
- CXTDT-549901 - RadioBox strike through state
|
||||
- CXTDT-546824 - Notification - Accessibility - Improper label for close notification button & icon
|
||||
|
||||
1.0.59
|
||||
----------------
|
||||
|
||||
Loading…
Reference in New Issue
Block a user