diff --git a/VDS/Components/Calendar/Calendar.swift b/VDS/Components/Calendar/Calendar.swift index fd3e3452..b023cf90 100644 --- a/VDS/Components/Calendar/Calendar.swift +++ b/VDS/Components/Calendar/Calendar.swift @@ -126,7 +126,7 @@ open class CalendarBase: Control, Changeable { /// 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 = true + isAccessibilityElement = false accessibilityLabel = "Calendar" addSubview(containerView) containerView diff --git a/VDS/Components/Calendar/CalendarFooterReusableView.swift b/VDS/Components/Calendar/CalendarFooterReusableView.swift index 9547084f..6a713428 100644 --- a/VDS/Components/Calendar/CalendarFooterReusableView.swift +++ b/VDS/Components/Calendar/CalendarFooterReusableView.swift @@ -31,6 +31,8 @@ class CalendarFooterReusableView: UICollectionReusableView { internal var containerView = View().with { $0.clipsToBounds = true + $0.isAccessibilityElement = true + $0.accessibilityLabel = "Legend" } private let flowLayout = LeftAlignedCollectionViewFlowLayout().with { @@ -40,6 +42,13 @@ class CalendarFooterReusableView: UICollectionReusableView { $0.scrollDirection = .vertical } + open override var accessibilityElements: [Any]? { + get { + return [containerView, legendLabels] + } + set { super.accessibilityElements = newValue } + } + open lazy var legendCollectionView = UICollectionView(frame: .zero, collectionViewLayout: flowLayout).with { $0.isScrollEnabled = false $0.translatesAutoresizingMaskIntoConstraints = false @@ -55,7 +64,8 @@ class CalendarFooterReusableView: UICollectionReusableView { } private var topConstraint: NSLayoutConstraint? - + private var legendLabels: [Label] = [] + //-------------------------------------------------- // MARK: - Initializers //-------------------------------------------------- @@ -94,6 +104,7 @@ class CalendarFooterReusableView: UICollectionReusableView { func update(with surface: Surface, indicators: [CalendarBase.CalendarIndicatorModel]) { self.items = indicators self.surface = surface + legendLabels.removeAll() legendCollectionView.reloadData() var height = legendCollectionView.collectionViewLayout.collectionViewContentSize.height @@ -124,6 +135,7 @@ extension CalendarFooterReusableView: UICollectionViewDelegate, UICollectionView surface: self.surface, clearFullcircle: indexPath.row == 1, drawSemiCircle: indexPath.row == 2) + legendLabels.append(cell.title) return cell } @@ -144,12 +156,12 @@ private class LegendCollectionViewCell: UICollectionViewCell { private let indicatorColorConfiguration = SurfaceColorConfiguration(VDSColor.elementsSecondaryOnlight, VDSColor.elementsSecondaryOndark) - private var title: Label = Label().with { + open var title: Label = Label().with { $0.translatesAutoresizingMaskIntoConstraints = false $0.textAlignment = .left $0.numberOfLines = 1 $0.textStyle = .bodySmall - $0.isAccessibilityElement = false + $0.isAccessibilityElement = true $0.backgroundColor = .clear } diff --git a/VDS/Components/Calendar/CalendarHeaderReusableView.swift b/VDS/Components/Calendar/CalendarHeaderReusableView.swift index d0f7f247..f9c8395d 100644 --- a/VDS/Components/Calendar/CalendarHeaderReusableView.swift +++ b/VDS/Components/Calendar/CalendarHeaderReusableView.swift @@ -86,7 +86,7 @@ class CalendarHeaderReusableView: UICollectionReusableView { $0.numberOfLines = 1 $0.textStyle = .boldBodySmall $0.backgroundColor = .clear - $0.isAccessibilityElement = false + $0.isAccessibilityElement = true } internal let daysOfWeek = Date.capitalizedFirstLettersOfWeekdays @@ -212,7 +212,7 @@ private class collectionViewCell: UICollectionViewCell { $0.numberOfLines = 1 $0.textStyle = .bodySmall $0.backgroundColor = .clear - $0.isAccessibilityElement = false + $0.isAccessibilityElement = true } //-------------------------------------------------- diff --git a/VDS/SupportingFiles/ReleaseNotes.txt b/VDS/SupportingFiles/ReleaseNotes.txt index ac767368..f226b47e 100644 --- a/VDS/SupportingFiles/ReleaseNotes.txt +++ b/VDS/SupportingFiles/ReleaseNotes.txt @@ -3,6 +3,7 @@ - CXTDT-556996 - RadioboxGroup – Accessibility - Voice over does not render the group position - CXTDT-560458 - Dropdown & TextArea voiceover behaviour - CXTDT-560485 - Tilelet - Accessibility +- CXTDT-559318 - Calendar - Accessibility 1.0.64 ----------------