Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Fix/price slider aria values #4839

Merged
merged 2 commits into from
Oct 6, 2021
Merged
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
5 changes: 5 additions & 0 deletions assets/js/base/components/price-slider/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,9 @@ const PriceSlider = ( {
const maxRangeStep =
activeElement && activeElement === maxRange.current ? stepValue : 1;

const ariaReadableMinPrice = minPriceInput / 10 ** currency.minorUnit;
const ariaReadableMaxPrice = maxPriceInput / 10 ** currency.minorUnit;

return (
<div className={ classes }>
<div
Expand All @@ -270,6 +273,7 @@ const PriceSlider = ( {
'Filter products by minimum price',
'woo-gutenberg-products-block'
) }
aria-valuetext={ ariaReadableMinPrice }
value={
Number.isFinite( minPrice )
? minPrice
Expand All @@ -290,6 +294,7 @@ const PriceSlider = ( {
'Filter products by maximum price',
'woo-gutenberg-products-block'
) }
aria-valuetext={ ariaReadableMaxPrice }
value={
Number.isFinite( maxPrice )
? maxPrice
Expand Down