-
Notifications
You must be signed in to change notification settings - Fork 254
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: fix JS error on setLanguage call (#2328)
When there is a component that uses CLDR and someone calls **setLanguage**, this causes the webcomponents to re-render and recalculate their state and it turns out that the CLDR for the newly set language is missing and JS error is thrown ("Error: CLDR data for locale de is not loaded"). Currently, this can be seen in our "RTL.html" page, if we add a DatePicker and then use the buttons on the page to change the language. This PR ensures that upon setLanguage, the CLDR is fetched/updated before the re-rendering. On the other hand, there is **applyDirection** API that also force re-rendering, that if used together with setLanguage, should wait for the setLanguage to complete to allow the message bundles (although they won't fail with JS error) and CLDR to load.
- Loading branch information
Showing
2 changed files
with
26 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters