You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This function fails when the data-max and data-min values from the input field are formatted with a , instead of a .
from facets.js asset:
`adjustToValidValues(input) {
// Normalize the value by replacing commas with periods
const normalizedValue = input.value.replace(/,/g, '.');
const value = Number(normalizedValue);
const min = Number(input.getAttribute('data-min'));
const max = Number(input.getAttribute('data-max'));
if (value < min) input.value = min;
if (value > max) input.value = max;
Describe the current behavior
This function fails when the data-max and data-min values from the input field are formatted with a , instead of a .
from facets.js asset:
`adjustToValidValues(input) {
// Normalize the value by replacing commas with periods
const normalizedValue = input.value.replace(/,/g, '.');
const value = Number(normalizedValue);
const min = Number(input.getAttribute('data-min'));
const max = Number(input.getAttribute('data-max'));
}`
The result of min and max variable are NaN.
from price-facet.liquid snippet:
Describe the expected behavior
The result of min and max variable are formatted as a number.
Version information (Dawn, browsers and operating systems)
Possible solution
add
| replace: ",", "." }}
to the data-max and data-min values.example:
Additional context/screenshots
Before using
| replace: ",", "." }}
After using
| replace: ",", "." }}
The text was updated successfully, but these errors were encountered: