Skip to content

Commit 6589a14

Browse files
evil159github-actions[bot]
authored andcommitted
Fix info button not having correct accessibility label (#3502)
Because `InfoButtonOrnament` is a `UIView` the `accesibilityLabel` property is ignored. To address this we need to explicitly mark it as an accessibility element and assign proper trait to it. Alternative solution could be to assign accessibility label to the internal `UIButton` instance, but I've decided against it as then the label won't be configurable by external customers. Addresses: https://mapbox.atlassian.net/browse/MAPSIOS-1825 cc @mapbox/sdk-ci GitOrigin-RevId: 7e32856f09c39a86bdbc45a7b5acfe174dd426d9
1 parent 6532027 commit 6589a14

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Sources/MapboxMaps/Ornaments/InfoButtonOrnament.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ internal class InfoButtonOrnament: UIView {
3232
button.addTarget(self, action: #selector(infoTapped), for: .primaryActionTriggered)
3333

3434
let bundle = Bundle.mapboxMaps
35+
isAccessibilityElement = true
36+
accessibilityTraits = [.button]
3537
accessibilityLabel = NSLocalizedString("INFO_A11Y_LABEL",
3638
tableName: Ornaments.localizableTableName,
3739
bundle: bundle,

0 commit comments

Comments
 (0)