fix(InputNumber/InputDate/InputTime/Calendar): restore locale prop#6546
Conversation
Re-expose the `locale` prop on components wrapping locale-aware Reka roots so a single input can be localized without changing the global locale. When undefined, it falls back to the `UApp` / `ConfigProvider` locale. Resolves #6542
d5a2ef5 to
b121815
Compare
📝 WalkthroughWalkthroughThis PR restores Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
commit: |
locale prop
|
@benjamincanac Thank you! |
🔗 Linked issue
Resolves #6542
❓ Type of change
📚 Description
Restores the
localeprop on the components that wrap locale-aware Reka roots, so a single field can be localized narrowly without changing the whole app's locale (e.g. a coordinates input that needs a.decimal separator while the app runs inru).The prop was dropped from these components via
Omit<..., 'locale'>. Re-adding it is enough since they already forward props throughuseForwardProps. Reka'suseLocaleresolveslocale?.value || context.locale || "en", so when the prop isundefinedit falls back to the globalUApp/ConfigProviderlocale.InputNumber—NumberFieldRootInputDate—DateFieldRoot/DateRangeFieldRootInputTime—TimeFieldRoot/TimeRangeFieldRootCalendar—CalendarRoot/RangeCalendarRoot(also used for week-number formatting viaprops.locale ?? locale.code)ColorPickerdoesn't need it, it's a customPrimitive-based implementation that doesn't wrapColorFieldRoot.📝 Checklist