Fixed
Status Update
Comments
ma...@google.com <ma...@google.com> #2
sg...@google.com <sg...@google.com>
sg...@google.com <sg...@google.com> #4
The release notes documentation has been edited to clarify this change in behavior for line height.
To support non-standard text sizes, we encourage users to follow the Material design system and use a different style = LocalTextStyle.current.copy(lineHeight = TextUnit.Unspecified)
, or create a custom Typography
entirely.
na...@google.com <na...@google.com> #5
deleted
Description
Environment
Description
The DatePicker component in Jetpack Compose Material 3 does not respect the locale setting provided through DatePickerState. Despite explicitly setting a locale (e.g., Locale("hr", "HR")), the DatePicker continues to use the system's default locale as determined by LocalConfiguration.current.locales[0]. The specified locale is installed on the device.
Expected Behavior
When a locale is explicitly set in DatePickerState, the DatePicker UI should adapt to use this locale for localizing labels, captions, titles, etc. If the specified locale is not installed on the device, it should fall back to using LocalConfiguration.current.locales[0].
Current Behavior
The DatePicker ignores the explicitly set locale in DatePickerState and always uses the system's default locale. This results in the UI not being localized according to the specified locale, affecting user experience for non-default language users.
Steps to Reproduce
Code sample
Probable Cause
The DatePicker implementation seems to ignore the locale parameter in DatePickerState, defaulting to the system's default locale. This is evident in the construction of the calendarModel within the DatePicker, where defaultLocale() is always used regardless of the locale specified in the state.
Suggested Fix
Modify the DatePicker implementation to respect the locale provided in DatePickerState when creating the calendarModel, ensuring that UI elements are correctly localized.
Additional Information
While the recommended approach for managing DatePickerState is through rememberDatePickerState, it does not allow for explicit localization settings via the locale parameter. This limitation becomes apparent in use cases requiring specific locale settings that differ from the system default. Although it's possible to manually implement a rememberSaveable solution that includes the locale, providing a first-class support or clearer guidance for such scenarios within the Compose framework would enhance its usability and flexibility for developers facing similar localization requirements.