File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed
components/src/main/java/uk/gov/hmrc/components/molecule/selectrow Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,10 @@ Allowed headings:
1616
1717## [ Unreleased]
1818
19+ ### Changed
20+
21+ * When an error is displayed on a ` SelectRowGroup ` component, then the error content description will have the prefix "Error:"
22+
1923## [ 4.3.1] - 2022-12-28
2024
2125### Additions
Original file line number Diff line number Diff line change @@ -92,8 +92,15 @@ class SelectRowGroup @JvmOverloads constructor(
9292 fun setError (error : String ) {
9393 binding.selectRowError.apply {
9494 text = error
95- if (error.isNotEmpty()) announceForAccessibility(error)
96- visibility = if (error.isNotEmpty()) View .VISIBLE else View .GONE
95+ if (error.isNotEmpty()) {
96+ val errorContentDescription = context.getString(R .string.accessibility_error_prefix, error)
97+ contentDescription = errorContentDescription
98+ announceForAccessibility(errorContentDescription)
99+ visibility = View .VISIBLE
100+ } else {
101+ contentDescription = error
102+ visibility = View .GONE
103+ }
97104 }
98105 }
99106
You can’t perform that action at this time.
0 commit comments