CXTDT-552842 - Accessibility - Breadcrumbs - The breadcrumb links are not properly placed within a breadcrumbs region.
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
parent
3f36d8b8c9
commit
99978ead11
@ -96,7 +96,7 @@ open class BreadcrumbItem: ButtonBase {
|
||||
/// Used to update any Accessibility properties.
|
||||
open override func updateAccessibility() {
|
||||
super.updateAccessibility()
|
||||
accessibilityLabel = "Breadcrumb \(text ?? "")"
|
||||
accessibilityLabel = text
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -39,6 +39,13 @@ open class Breadcrumbs: View {
|
||||
}
|
||||
}
|
||||
|
||||
open override var accessibilityElements: [Any]? {
|
||||
get {
|
||||
return [containerView, breadcrumbs]
|
||||
}
|
||||
set {}
|
||||
}
|
||||
|
||||
/// A callback when the selected item changes. Passes parameters (crumb).
|
||||
open var onBreadcrumbDidSelect: ((BreadcrumbItem) -> Void)?
|
||||
|
||||
@ -73,6 +80,11 @@ open class Breadcrumbs: View {
|
||||
return collectionView
|
||||
}()
|
||||
|
||||
private let containerView = View().with {
|
||||
$0.isAccessibilityElement = true
|
||||
$0.accessibilityLabel = "Breadcrumbs"
|
||||
}
|
||||
|
||||
//--------------------------------------------------
|
||||
// MARK: - Private Methods
|
||||
//--------------------------------------------------
|
||||
@ -106,8 +118,10 @@ open class Breadcrumbs: View {
|
||||
/// Executed on initialization for this View.
|
||||
open override func initialSetup() {
|
||||
super.initialSetup()
|
||||
addSubview(collectionView)
|
||||
containerView.addSubview(collectionView)
|
||||
collectionView.pinToSuperView()
|
||||
addSubview(containerView)
|
||||
containerView.pinToSuperView()
|
||||
}
|
||||
|
||||
/// Resets to default settings.
|
||||
@ -124,7 +138,7 @@ open class Breadcrumbs: View {
|
||||
super.updateView()
|
||||
collectionView.reloadData()
|
||||
}
|
||||
|
||||
|
||||
open override func layoutSubviews() {
|
||||
//Turn off the ability to execute updateView() in the super
|
||||
//since we don't want an infinite loop
|
||||
@ -139,6 +153,7 @@ open class Breadcrumbs: View {
|
||||
}
|
||||
}
|
||||
private var separatorWidth = Label().with { $0.text = "/"; $0.sizeToFit() }.intrinsicContentSize.width
|
||||
|
||||
}
|
||||
|
||||
extension Breadcrumbs: UICollectionViewDelegate, UICollectionViewDataSource, ButtongGroupPositionLayoutDelegate {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user