mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
chore(): sync feature-6.2 with main
This commit is contained in:
@@ -1128,6 +1128,13 @@ export class Datetime implements ComponentInterface {
|
||||
|
||||
this.initializeListeners();
|
||||
|
||||
/**
|
||||
* The month/year picker from the date interface
|
||||
* should be closed as it is not available in non-date
|
||||
* interfaces.
|
||||
*/
|
||||
this.showMonthAndYear = false;
|
||||
|
||||
raf(() => {
|
||||
this.ionRender.emit();
|
||||
});
|
||||
|
||||
@@ -83,6 +83,27 @@ test.describe('datetime: presentation', () => {
|
||||
|
||||
expect(ionChangeSpy.length).toBe(1);
|
||||
});
|
||||
|
||||
test('switching presentation should close month/year picker', async ({ page }, testInfo) => {
|
||||
await test.skip(testInfo.project.metadata.rtl === true, 'This feature does not have RTL specific behaviors.');
|
||||
|
||||
await page.setContent(`
|
||||
<ion-datetime presentation="date"></ion-datetime>
|
||||
`);
|
||||
|
||||
await page.waitForSelector('.datetime-ready');
|
||||
|
||||
const datetime = page.locator('ion-datetime');
|
||||
const monthYearButton = page.locator('ion-datetime .calendar-month-year');
|
||||
await monthYearButton.click();
|
||||
|
||||
await expect(datetime).toHaveClass(/show-month-and-year/);
|
||||
|
||||
await datetime.evaluate((el: HTMLIonDatetimeElement) => (el.presentation = 'time'));
|
||||
await page.waitForChanges();
|
||||
|
||||
await expect(datetime).not.toHaveClass(/show-month-and-year/);
|
||||
});
|
||||
});
|
||||
|
||||
test.describe('datetime: presentation: time', () => {
|
||||
|
||||
Reference in New Issue
Block a user