Bug - [Slider with Input] - [should accept , as comma for non en US locales]
Describe the problem This is an issue with
- [x] Patternfly 6
When using <Slider isInputVisible />, if the adjacent input is initialized with a non-English decimal separator (comma, e.g. "50,2"), the component breaks: the slider/input get out of sync and/or parsing fails. This happens even when the page/parent container has a non-EN lang (e.g. lang="el").
Affected components: Slider (with isInputVisible, value, inputValue)
How do you reproduce the problem? https://codesandbox.io/p/sandbox/3kn8jh?file=%2Findex.tsx
Expected behavior The input next to the slider should accept and display localized decimal separators in line with the container/page lang.
The slider should internally normalize user input (comma or dot) and maintain a numeric state.
Is this issue blocking you? No, I am now normalizing the input myself.
What is your product and what release date are you targeting? anaconda installer, no specific target
@KKoukiou Just to confirm some things:
- Is it expected that you would pass in a string like
"50,2"to theinputValueprop - from there, PF would transform that string to a decimal number internal to the component
- that transformed number would be what's displayed in the input as well as what's stored internally
- Or rather, is the expectation that the input would still display the commas
50,2, and just internally the component would transform to a decimal to do any calculations, then render it back in the input with the comma again
- Or rather, is the expectation that the input would still display the commas
The same confirmations above would likely apply to the slider steps as well, in terms of their value and displayed label.
Would you also be able to confirm whether this is something specific to Slider, or if there are other instances of numbers needed for input where this is a problem? Thinking namely of the NumberInput component
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.