From 2745def02e7d9e283c88f0017ac26fe9c5e3e386 Mon Sep 17 00:00:00 2001 From: Maria Hutt Date: Thu, 22 Jan 2026 14:05:54 -0800 Subject: [PATCH 1/3] feat(datetime): add wheel part to ion-picker-column --- core/src/components/datetime/datetime.tsx | 9 +++ .../datetime/test/custom/datetime.e2e.ts | 56 +++++++++++++++++++ .../datetime/test/custom/index.html | 5 ++ 3 files changed, 70 insertions(+) diff --git a/core/src/components/datetime/datetime.tsx b/core/src/components/datetime/datetime.tsx index 3411f28eb57..95f97d37cf0 100644 --- a/core/src/components/datetime/datetime.tsx +++ b/core/src/components/datetime/datetime.tsx @@ -79,6 +79,7 @@ import { checkForPresentationFormatMismatch, warnIfTimeZoneProvided } from './ut * @slot buttons - The buttons in the datetime. * @slot time-label - The label for the time selector in the datetime. * + * @part wheel - The wheel container when using a wheel style layout, or in the month/year picker when using a grid style layout. * @part wheel-item - The individual items when using a wheel style layout, or in the * month/year picker when using a grid style layout. * @part wheel-item active - The currently selected wheel-item. @@ -1724,6 +1725,7 @@ export class Datetime implements ComponentInterface { return ( { await expect(datetime).toHaveScreenshot(screenshot(`datetime-custom-calendar-days`)); }); }); + + test.describe(title('CSS shadow parts'), () => { + test('should be able to customize wheel part', async ({ page }) => { + await page.setContent( + ` + + + `, + config + ); + + const datetime = page.locator('ion-datetime'); + const pickerColumn = datetime.locator('ion-picker-column').first(); + + const backgroundColor = await pickerColumn.evaluate((el) => { + return window.getComputedStyle(el).backgroundColor; + }); + + expect(backgroundColor).toBe('rgb(255, 0, 0)'); + }); + + test('should be able to customize wheel part when focused', async ({ page }) => { + await page.setContent( + ` + + + `, + config + ); + + const datetime = page.locator('ion-datetime'); + const pickerColumn = datetime.locator('ion-picker-column').first(); + + await pickerColumn.click({ position: { x: 10, y: 10 } }); + + const backgroundColor = await pickerColumn.evaluate((el) => { + return window.getComputedStyle(el).backgroundColor; + }); + + expect(backgroundColor).toBe('rgb(0, 0, 255)'); + }); + }); }); /** diff --git a/core/src/components/datetime/test/custom/index.html b/core/src/components/datetime/test/custom/index.html index 09895d9c591..c52d059f8ed 100644 --- a/core/src/components/datetime/test/custom/index.html +++ b/core/src/components/datetime/test/custom/index.html @@ -74,6 +74,11 @@ color: rgb(128, 30, 171); } + .custom-grid-wheel::part(wheel):focus, + ion-picker-column:focus { + background-color: rgba(138, 238, 69, 0.37); + } + /* * Custom Datetime Day Parts * ------------------------------------------- From 1ba93f1404093e6ac46f4ff47594037e2def393a Mon Sep 17 00:00:00 2001 From: Maria Hutt Date: Thu, 22 Jan 2026 14:09:55 -0800 Subject: [PATCH 2/3] test(datetime): add testinfo --- .../datetime/test/custom/datetime.e2e.ts | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/core/src/components/datetime/test/custom/datetime.e2e.ts b/core/src/components/datetime/test/custom/datetime.e2e.ts index 3ee24c567fb..b7f44cbc614 100644 --- a/core/src/components/datetime/test/custom/datetime.e2e.ts +++ b/core/src/components/datetime/test/custom/datetime.e2e.ts @@ -44,7 +44,12 @@ configs({ directions: ['ltr'] }).forEach(({ title, screenshot, config }) => { }); test.describe(title('CSS shadow parts'), () => { - test('should be able to customize wheel part', async ({ page }) => { + test('should be able to customize wheel part', async ({ page }, testInfo) => { + testInfo.annotations.push({ + type: 'issue', + description: 'https://github.com/ionic-team/ionic-framework/issues/30420', + }); + await page.setContent( `