Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions packages/base/src/UI5Element.ts
Original file line number Diff line number Diff line change
Expand Up @@ -898,6 +898,16 @@ abstract class UI5Element extends HTMLElement {
*/
_render() {
const ctor = this.constructor as typeof UI5Element;

// Skip rendering language-aware components while a language change (CLDR + i18n fetch) is
// still in flight. reRenderAllUI5Elements({ languageAware: true }) will re-render them once
// the data is ready. Without this guard, a component added to the render queue *before* the
// language change started (e.g. via renderDeferred) can still call onBeforeRendering and
// onAfterRendering with stale or missing locale data.
if (ctor.getMetadata().isLanguageAware() && getLanguageChangePending()) {
return;
}

const hasIndividualSlots = ctor.getMetadata().hasIndividualSlots();

// restore properties that were initialized before `define` by calling the setter
Expand Down
18 changes: 13 additions & 5 deletions packages/main/cypress/specs/DatePicker.cy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import DatePicker from "../../src/DatePicker.js";
import Label from "../../src/Label.js";
import { DATEPICKER_POPOVER_ACCESSIBLE_NAME } from "../../src/generated/i18n/i18n-defaults.js";

describe.skip("Date Picker Tests", () => {
describe("Date Picker Tests", () => {
it("input renders", () => {
cy.mount(<DatePicker></DatePicker>);

Expand Down Expand Up @@ -34,7 +34,9 @@ describe.skip("Date Picker Tests", () => {

it("input receives value in format pattern depending on the set language", () => {
cy.wrap({ setLanguage })
.then(api => api.setLanguage("bg"));
.then(api => {
return api.setLanguage("bg");
});

cy.mount(<DatePicker value="11 декември 2018г." formatPattern="long"></DatePicker>);

Expand All @@ -58,7 +60,9 @@ describe.skip("Date Picker Tests", () => {
.should("have.class", "ui5-dp-item--selected");

cy.wrap({ setLanguage })
.then(api => api.setLanguage("en"));
.then(api => {
return api.setLanguage("en");
});
});

it("custom formatting", () => {
Expand Down Expand Up @@ -318,7 +322,9 @@ describe.skip("Date Picker Tests", () => {

it("respect first day of the week - monday", () => {
cy.wrap({ setLanguage })
.then(api => api.setLanguage("bg"));
.then(api => {
return api.setLanguage("bg");
});

cy.mount(<DatePicker value="фев 6, 2019" formatPattern="MMM d, y"></DatePicker>);

Expand All @@ -338,7 +344,9 @@ describe.skip("Date Picker Tests", () => {
.should("have.class", "ui5-dp-wday6");

cy.wrap({ setLanguage })
.then(api => api.setLanguage("en"));
.then(api => {
return api.setLanguage("en");
});
});

it("if today is 30 jan, clicking next month does not skip feb", () => {
Expand Down
4 changes: 3 additions & 1 deletion packages/main/cypress/specs/DateRangePicker.cy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ function DateRangePickerTemplate(options: DateTimePickerTemplateOptions) {

describe("DateRangePicker general interaction", () => {
afterEach(() => {
cy.wrap({ setLanguage }).then(api => api.setLanguage("en"));
cy.wrap({ setLanguage }).then(api => {
return api.setLanguage("en");
});
});

it("Custom Validation Error", () => {
Expand Down
Loading