Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(range): fix aria-label value - FRONT-4341 #3332

Merged
merged 4 commits into from
Apr 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2650,7 +2650,7 @@ exports[`Form group with Range field renders correctly 1`] = `
</div>
<input
aria-describedby="example-range-id-helper"
aria-label="example-range-id"
aria-label="Value: "
class="ecl-range ecl-range--m"
data-ecl-range-input=""
id="example-range-id"
Expand Down Expand Up @@ -2700,7 +2700,7 @@ exports[`Form group with Range field renders correctly when disabled 1`] = `
</div>
<input
aria-describedby="example-range-id-helper"
aria-label="example-range-id"
aria-label="Value: "
class="ecl-range ecl-range--m"
data-ecl-range-input=""
disabled=""
Expand Down Expand Up @@ -2752,7 +2752,7 @@ exports[`Form group with Range field renders correctly when invalid 1`] = `
<input
aria-describedby="example-range-id-helper example-range-id-invalid"
aria-invalid="true"
aria-label="example-range-id"
aria-label="Value: "
class="ecl-range ecl-range--invalid ecl-range--m"
data-ecl-range-input=""
id="example-range-id"
Expand Down Expand Up @@ -2821,7 +2821,7 @@ exports[`Form group with Range field renders correctly when required 1`] = `
</div>
<input
aria-describedby="example-range-id-helper"
aria-label="example-range-id"
aria-label="Value: "
class="ecl-range ecl-range--m"
data-ecl-range-input=""
id="example-range-id"
Expand Down Expand Up @@ -2874,7 +2874,7 @@ exports[`Form group with Range field renders correctly with extra attributes 1`
</div>
<input
aria-describedby="example-range-id-helper"
aria-label="example-range-id"
aria-label="Value: "
class="ecl-range ecl-range--m"
data-ecl-range-input=""
id="example-range-id"
Expand Down Expand Up @@ -2924,7 +2924,7 @@ exports[`Form group with Range field renders correctly with extra class names 1
</div>
<input
aria-describedby="example-range-id-helper"
aria-label="example-range-id"
aria-label="Value: "
class="ecl-range ecl-range--m"
data-ecl-range-input=""
id="example-range-id"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
exports[`Range Default renders correctly 1`] = `
<jest>
<input
aria-label="example-range-id"
aria-label="Value: "
class="ecl-range ecl-range--m"
data-ecl-range-input=""
id="example-range-id"
Expand All @@ -26,7 +26,7 @@ exports[`Range Default renders correctly 1`] = `
exports[`Range Default renders correctly with extra attributes 1`] = `
<jest>
<input
aria-label="example-range-id"
aria-label="Value: "
class="ecl-range ecl-range--m"
data-ecl-range-input=""
data-test="data-test-value"
Expand All @@ -51,7 +51,7 @@ exports[`Range Default renders correctly with extra attributes 1`] = `
exports[`Range Default renders correctly with extra class names 1`] = `
<jest>
<input
aria-label="example-range-id"
aria-label="Value: "
class="ecl-range ecl-range--m custom-class custom-class--test"
data-ecl-range-input=""
id="example-range-id"
Expand All @@ -74,7 +74,7 @@ exports[`Range Default renders correctly with extra class names 1`] = `
exports[`Range Invalid renders correctly 1`] = `
<jest>
<input
aria-label="example-range-id"
aria-label="Value: "
class="ecl-range ecl-range--invalid ecl-range--m"
data-ecl-range-input=""
id="example-range-id"
Expand All @@ -97,7 +97,7 @@ exports[`Range Invalid renders correctly 1`] = `
exports[`Range Optional renders correctly 1`] = `
<jest>
<input
aria-label="example-range-id"
aria-label="Value: "
class="ecl-range ecl-range--m"
data-ecl-range-input=""
id="example-range-id"
Expand Down
4 changes: 3 additions & 1 deletion src/implementations/twig/components/range/range.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,9 @@
class="{{ _css_class }}"
{% if _id %}
id="{{ _id }}"
aria-label="{{ _id }}"
{% endif %}
{% if _value_text is not empty %}
aria-label="{{ _value_text }}"
{% endif %}
{% if _name is not empty %}
name="{{ _name }}"
Expand Down
Loading