Skip to content

Commit

Permalink
Merge pull request #570 from adevinta/radio_group_accessibility_ident…
Browse files Browse the repository at this point in the history
…ifier

[RadioButton]add accessibility identifier on Radio Group title
  • Loading branch information
AliouSARR authored Oct 25, 2023
2 parents 7ce02a5 + 84bfd8f commit 7ef3e18
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ public enum RadioButtonAccessibilityIdentifier {

public static let radioButton = "spark-radio-button"

/// The radio group title accessibility identifier.
public static let radioButtonGroupTitle = "spark-radio-button-group-title"

public static func radioButtonIdentifier<ID: CustomStringConvertible>(id: ID) -> String {
return "\(radioButton)-\(id)"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ public struct RadioButtonGroupView<ID: Equatable & Hashable & CustomStringConver
.fixedSize(horizontal: false, vertical: true)
.font(self.viewModel.titleFont.font)
.foregroundColor(self.viewModel.titleColor.color)
.accessibilityIdentifier(RadioButtonAccessibilityIdentifier.radioButtonGroupTitle)
}

@ViewBuilder
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public final class RadioButtonUIGroupView<ID: Equatable & Hashable & CustomStrin
let label = UILabel()
label.adjustsFontForContentSizeCategory = true
label.translatesAutoresizingMaskIntoConstraints = false

label.accessibilityIdentifier = RadioButtonAccessibilityIdentifier.radioButtonGroupTitle
return label
}()

Expand Down

0 comments on commit 7ef3e18

Please sign in to comment.