Skip to content

Commit

Permalink
Bugfix FXIOS-10512 ⁃ [Menu] [Accessibility] - "Tools" and "Save" head…
Browse files Browse the repository at this point in the history
…ers are not announced (backport #23078) (#23088)

Bugfix FXIOS-10512 ⁃ [Menu] [Accessibility] - "Tools" and "Save" headers are not announced (#23078)

FXIOS-10512 #23050 ⁃ [Menu redesign] [Accessibility] - "Tools" and "Save" headers are not announced

(cherry picked from commit 52f77c9)

Co-authored-by: dicarobinho <61138287+dicarobinho@users.noreply.github.com>
  • Loading branch information
mergify[bot] and dicarobinho authored Nov 13, 2024
1 parent 10ba680 commit 00d0299
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,16 @@ public final class NavigationHeaderView: UIView {

public func setupAccessibility(closeButtonA11yLabel: String,
closeButtonA11yId: String,
titleA11yId: String? = nil,
backButtonA11yLabel: String,
backButtonA11yId: String) {
let closeButtonViewModel = CloseButtonViewModel(a11yLabel: closeButtonA11yLabel,
a11yIdentifier: closeButtonA11yId)
closeButton.configure(viewModel: closeButtonViewModel)
if let titleA11yId {
titleLabel.isAccessibilityElement = true
titleLabel.accessibilityIdentifier = titleA11yId
}
backButton.accessibilityIdentifier = backButtonA11yId
backButton.accessibilityLabel = backButtonA11yLabel
}
Expand Down
2 changes: 2 additions & 0 deletions BrowserKit/Sources/MenuKit/MenuDetailView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,12 @@ public final class MenuDetailView: UIView,

public func setupAccessibilityIdentifiers(closeButtonA11yLabel: String,
closeButtonA11yId: String,
titleA11yId: String? = nil,
backButtonA11yLabel: String,
backButtonA11yId: String) {
detailHeaderView.setupAccessibility(closeButtonA11yLabel: closeButtonA11yLabel,
closeButtonA11yId: closeButtonA11yId,
titleA11yId: titleA11yId,
backButtonA11yLabel: backButtonA11yLabel,
backButtonA11yId: backButtonA11yId)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ public struct AccessibilityIdentifiers {

struct NavigationHeaderView {
static let backButton = "MainMenu.BackButton"
static let title = "MainMenu.Title"
static let closeButton = "MainMenu.CloseMenuButton"
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ class MainMenuDetailsViewController: UIViewController,
submenuContent.setupAccessibilityIdentifiers(
closeButtonA11yLabel: .MainMenu.Account.AccessibilityLabels.CloseButton,
closeButtonA11yId: AccessibilityIdentifiers.MainMenu.NavigationHeaderView.closeButton,
titleA11yId: AccessibilityIdentifiers.MainMenu.NavigationHeaderView.title,
backButtonA11yLabel: .MainMenu.Account.AccessibilityLabels.BackButton,
backButtonA11yId: AccessibilityIdentifiers.MainMenu.NavigationHeaderView.backButton)
}
Expand Down

0 comments on commit 00d0299

Please sign in to comment.