InputNumber: number formatting does not update when locale is set through PrimeReactContext #6584
Labels
Type: Bug
Issue contains a defect related to a specific component.
Milestone
Describe the bug
When the current locale is updated using PrimeReactContext, it is not properly picked up by InputNumber. Moreover, after changing the locale, seemingly arbitrary input is added when editing the field content.
The problem could be that in InputNumber.js in line 1136 (https://github.com/primefaces/primereact/blob/master/components/lib/inputnumber/InputNumber.js#L1136), the parser is reconstructed only when
props.locale
changes, but not when_locale
changes, which is derived from the locale set in PrimeReactContext.Reproducer
https://stackblitz.com/edit/rkhk7w?file=src%2FApp.jsx
PrimeReact version
10.5.1
React version
18.x
Language
TypeScript
Build / Runtime
Vite
Browser(s)
Chrome 124, Firefox 125
Steps to reproduce the behavior
Expected behavior
The text was updated successfully, but these errors were encountered: