diff --git a/.github/workflows/actions/build-core-stencil-prerelease/action.yml b/.github/workflows/actions/build-core-stencil-prerelease/action.yml index 686e2e3de75..f1e33c8b55e 100644 --- a/.github/workflows/actions/build-core-stencil-prerelease/action.yml +++ b/.github/workflows/actions/build-core-stencil-prerelease/action.yml @@ -33,6 +33,10 @@ runs: run: npm run build -- --ci --debug --verbose working-directory: ./core shell: bash + - name: πŸ” Verify Lazy Imports + run: npm run test.lazy-imports + working-directory: ./core + shell: bash - name: πŸ•ΈοΈ Install React Package Dependencies run: npm ci working-directory: ./packages/react diff --git a/.github/workflows/actions/build-core/action.yml b/.github/workflows/actions/build-core/action.yml index 2ac2fd00836..523b303139a 100644 --- a/.github/workflows/actions/build-core/action.yml +++ b/.github/workflows/actions/build-core/action.yml @@ -27,6 +27,10 @@ runs: run: npm run build -- --ci working-directory: ./core shell: bash + - name: πŸ” Verify Lazy Imports + run: npm run test.lazy-imports + working-directory: ./core + shell: bash - uses: ./.github/workflows/actions/upload-archive with: name: ionic-core diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 38b60de26dd..0e27f252903 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -15,7 +15,7 @@ jobs: security-events: write steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - - uses: github/codeql-action/init@f205ea1c3313d32999d8d6a48b4f6530d4437b38 # v4.37.4 + - uses: github/codeql-action/init@5595ccaf912efad79be6eef63a5619ff05969be3 # v4.37.6 with: languages: javascript - - uses: github/codeql-action/analyze@f205ea1c3313d32999d8d6a48b4f6530d4437b38 # v4.37.4 + - uses: github/codeql-action/analyze@5595ccaf912efad79be6eef63a5619ff05969be3 # v4.37.6 diff --git a/CHANGELOG.md b/CHANGELOG.md index cd48dab52b3..fcd32072979 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,20 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [8.8.18](https://github.com/ionic-team/ionic-framework/compare/v8.8.17...v8.8.18) (2026-08-12) + + +### Bug Fixes + +* **core:** resolve lazy component chunks under Vite 8 ([#31341](https://github.com/ionic-team/ionic-framework/issues/31341)) ([a73e183](https://github.com/ionic-team/ionic-framework/commit/a73e1831d389e6dc968f646c0322b3984c1d3224)), closes [#31333](https://github.com/ionic-team/ionic-framework/issues/31333) +* **core:** update offsets when safe-area insets arrive late ([#31343](https://github.com/ionic-team/ionic-framework/issues/31343)) ([bc4fce2](https://github.com/ionic-team/ionic-framework/commit/bc4fce218d6c3aaac69f11d416b9fc8c8dacdfa4)), closes [#31337](https://github.com/ionic-team/ionic-framework/issues/31337) +* **datetime:** tear down ready state when an overlay dismisses ([#31335](https://github.com/ionic-team/ionic-framework/issues/31335)) ([d59e341](https://github.com/ionic-team/ionic-framework/commit/d59e3415df06cb26a7dea688f6720ba228b775d5)), closes [#31155](https://github.com/ionic-team/ionic-framework/issues/31155) [#31143](https://github.com/ionic-team/ionic-framework/issues/31143) +* **modal:** allow pull-to-refresh with a custom scroll host ([#31339](https://github.com/ionic-team/ionic-framework/issues/31339)) ([d6202a8](https://github.com/ionic-team/ionic-framework/commit/d6202a8933ad77735fceca05cb4b0fe6b33bfb55)), closes [#31332](https://github.com/ionic-team/ionic-framework/issues/31332) + + + + + ## [8.8.17](https://github.com/ionic-team/ionic-framework/compare/v8.8.16...v8.8.17) (2026-08-05) diff --git a/core/CHANGELOG.md b/core/CHANGELOG.md index 0a1cd3100a5..84ed9ee1068 100644 --- a/core/CHANGELOG.md +++ b/core/CHANGELOG.md @@ -3,6 +3,20 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [8.8.18](https://github.com/ionic-team/ionic-framework/compare/v8.8.17...v8.8.18) (2026-08-12) + + +### Bug Fixes + +* **core:** resolve lazy component chunks under Vite 8 ([#31341](https://github.com/ionic-team/ionic-framework/issues/31341)) ([a73e183](https://github.com/ionic-team/ionic-framework/commit/a73e1831d389e6dc968f646c0322b3984c1d3224)), closes [#31333](https://github.com/ionic-team/ionic-framework/issues/31333) +* **core:** update offsets when safe-area insets arrive late ([#31343](https://github.com/ionic-team/ionic-framework/issues/31343)) ([bc4fce2](https://github.com/ionic-team/ionic-framework/commit/bc4fce218d6c3aaac69f11d416b9fc8c8dacdfa4)), closes [#31337](https://github.com/ionic-team/ionic-framework/issues/31337) +* **datetime:** tear down ready state when an overlay dismisses ([#31335](https://github.com/ionic-team/ionic-framework/issues/31335)) ([d59e341](https://github.com/ionic-team/ionic-framework/commit/d59e3415df06cb26a7dea688f6720ba228b775d5)), closes [#31155](https://github.com/ionic-team/ionic-framework/issues/31155) [#31143](https://github.com/ionic-team/ionic-framework/issues/31143) +* **modal:** allow pull-to-refresh with a custom scroll host ([#31339](https://github.com/ionic-team/ionic-framework/issues/31339)) ([d6202a8](https://github.com/ionic-team/ionic-framework/commit/d6202a8933ad77735fceca05cb4b0fe6b33bfb55)), closes [#31332](https://github.com/ionic-team/ionic-framework/issues/31332) + + + + + ## [8.8.17](https://github.com/ionic-team/ionic-framework/compare/v8.8.16...v8.8.17) (2026-08-05) diff --git a/core/package-lock.json b/core/package-lock.json index 15447a664c2..78ca73b51d9 100644 --- a/core/package-lock.json +++ b/core/package-lock.json @@ -1,12 +1,12 @@ { "name": "@ionic/core", - "version": "8.8.17", + "version": "8.8.18", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@ionic/core", - "version": "8.8.17", + "version": "8.8.18", "license": "MIT", "dependencies": { "@stencil/core": "^4.43.5", diff --git a/core/package.json b/core/package.json index 8e884006b4b..ffdd040cc5a 100644 --- a/core/package.json +++ b/core/package.json @@ -1,6 +1,6 @@ { "name": "@ionic/core", - "version": "8.8.17", + "version": "8.8.18", "description": "Base components for Ionic", "engines": { "node": ">= 16" @@ -142,7 +142,8 @@ "test.e2e.update-snapshots": "npm run test.e2e -- --update-snapshots='changed'", "test.watch": "jest --watch --no-cache", "test.treeshake": "node scripts/treeshaking.js dist/index.js", - "validate": "npm run lint && npm run test && npm run build && npm run test.treeshake", + "test.lazy-imports": "node scripts/verify/lazy-imports.js", + "validate": "npm run lint && npm run test && npm run build && npm run test.lazy-imports && npm run test.treeshake", "docker.build": "docker build -t ionic-playwright .", "test.e2e.docker": "npm run docker.build && node ./scripts/docker.mjs", "test.e2e.docker.update-snapshots": "npm run test.e2e.docker -- --update-snapshots='changed'", diff --git a/core/scripts/verify/lazy-imports.js b/core/scripts/verify/lazy-imports.js new file mode 100644 index 00000000000..d0008130474 --- /dev/null +++ b/core/scripts/verify/lazy-imports.js @@ -0,0 +1,56 @@ +/** + * Fails if the built lazy loader is missing a literal import path for any component bundle. + * Not in `scripts/testing/` because `vercel-build.sh` publishes that directory. + * https://github.com/ionic-team/ionic-framework/issues/31333 + */ +const fs = require('fs'); +const path = require('path'); + +const PACKAGE_ROOT = path.resolve(__dirname, '..', '..'); +const OUTPUT_DIRS = ['dist/esm', 'dist/cjs']; + +function main() { + const failures = OUTPUT_DIRS.map(verify).filter((message) => message !== null); + + if (failures.length > 0) { + failures.forEach((message) => console.error(message)); + process.exit(1); + } + + console.error(`Success! Every lazy bundle is imported by path in ${OUTPUT_DIRS.join(' and ')}`); +} + +function verify(dir) { + const resolved = path.join(PACKAGE_ROOT, dir); + + if (!fs.existsSync(resolved)) { + return `${dir} does not exist. Run npm run build first.`; + } + + const files = fs.readdirSync(resolved).filter((file) => file.endsWith('.js')); + const entries = files.filter((file) => file.endsWith('.entry.js')); + + if (entries.length === 0) { + return `${dir} does not contain any .entry.js files.`; + } + + // A non-loader chunk that happens to name an entry file would be a false pass. + const loader = files + .filter((file) => !file.endsWith('.entry.js')) + .map((file) => fs.readFileSync(path.join(resolved, file), 'utf-8')) + .find((source) => /switch\s*\(bundleId\)/.test(source)); + + if (loader === undefined) { + return `${dir} has no lazy loader with a bundle id switch. Check that extras.enableImportInjection is still set in core/stencil.config.ts.`; + } + + const missing = entries.filter((entry) => !loader.includes(`'./${entry}'`) && !loader.includes(`"./${entry}"`)); + + if (missing.length > 0) { + return `${dir} is missing an import for ${missing.length} of ${entries.length} lazy bundles: ${missing.join(', ')}`; + } + + return null; +} + +main(); diff --git a/core/src/components.d.ts b/core/src/components.d.ts index a05658bf241..37ad13b6c01 100644 --- a/core/src/components.d.ts +++ b/core/src/components.d.ts @@ -927,7 +927,7 @@ export namespace Components { */ "clearText": string; /** - * The color to use from your application's color palette. Default options are: `"primary"`, `"secondary"`, `"tertiary"`, `"success"`, `"warning"`, `"danger"`, `"light"`, `"medium"`, and `"dark"`. For more information on colors, see [theming](/docs/theming/basics). + * The color to use from your application's color palette. Default options are: `"primary"`, `"secondary"`, `"tertiary"`, `"success"`, `"warning"`, `"danger"`, `"light"`, `"medium"`, and `"dark"`. For more information on colors, refer to [theming](/docs/theming/basics). */ "color"?: Color; /** @@ -6053,7 +6053,7 @@ declare namespace LocalJSX { */ "clearText"?: string; /** - * The color to use from your application's color palette. Default options are: `"primary"`, `"secondary"`, `"tertiary"`, `"success"`, `"warning"`, `"danger"`, `"light"`, `"medium"`, and `"dark"`. For more information on colors, see [theming](/docs/theming/basics). + * The color to use from your application's color palette. Default options are: `"primary"`, `"secondary"`, `"tertiary"`, `"success"`, `"warning"`, `"danger"`, `"light"`, `"medium"`, and `"dark"`. For more information on colors, refer to [theming](/docs/theming/basics). */ "color"?: Color; /** diff --git a/core/src/components/content/content.tsx b/core/src/components/content/content.tsx index b981a323dcf..b0673b414d5 100644 --- a/core/src/components/content/content.tsx +++ b/core/src/components/content/content.tsx @@ -1,5 +1,18 @@ import type { ComponentInterface, EventEmitter } from '@stencil/core'; -import { Build, Component, Element, Event, Host, Listen, Method, Prop, forceUpdate, h, readTask } from '@stencil/core'; +import { + Build, + Component, + Element, + Event, + Host, + Listen, + Method, + Prop, + Watch, + forceUpdate, + h, + readTask, +} from '@stencil/core'; import { componentOnReady, hasLazyBuild, inheritAriaAttributes } from '@utils/helpers'; import type { Attributes } from '@utils/helpers'; import { isPlatform } from '@utils/platform'; @@ -34,6 +47,7 @@ export class Content implements ComponentInterface { private backgroundContentEl?: HTMLElement; private isMainContent = true; private resizeTimeout: ReturnType | null = null; + private fullscreenResizeObserver?: ResizeObserver; private inheritedAttributes: Attributes = {}; private tabsElement: HTMLElement | null = null; @@ -77,6 +91,11 @@ export class Content implements ComponentInterface { */ @Prop() fullscreen = false; + @Watch('fullscreen') + fullscreenChanged() { + this.setupFullscreenResizeObserver(); + } + /** * Controls where the fixed content is placed relative to the main content * in the DOM. This can be used to control the order in which fixed elements @@ -168,6 +187,14 @@ export class Content implements ComponentInterface { closestTabs.addEventListener('ionTabBarLoaded', this.tabsLoadCallback); } } + + // Re-observe on reattach, since componentDidLoad only fires once. + this.setupFullscreenResizeObserver(); + } + + componentDidLoad() { + // The custom elements build assigns fullscreen after connectedCallback. + this.setupFullscreenResizeObserver(); } disconnectedCallback() { @@ -193,6 +220,49 @@ export class Content implements ComponentInterface { clearTimeout(this.resizeTimeout); this.resizeTimeout = null; } + + this.destroyFullscreenResizeObserver(); + } + + /** + * Header and footer sizes can change after load without a window resize + * firing, so the `resize` listener alone misses those changes. + * + * Popover content is excluded because `contain: none` lets its offsets drive + * the host's own height, which would feed back into the observer. + */ + private setupFullscreenResizeObserver() { + if (!Build.isBrowser || typeof ResizeObserver === 'undefined') { + return; + } + + if (!this.fullscreen || hostContext('ion-popover', this.el)) { + this.destroyFullscreenResizeObserver(); + return; + } + + if (this.fullscreenResizeObserver !== undefined) { + return; + } + + this.fullscreenResizeObserver = new ResizeObserver(() => { + // A hidden page reports a 0x0 box, which would zero the offsets. Same + // reasoning as the guard in onResize, minus its debounce so the + // correction lands in the next frame instead of 100ms later. + if (this.el.offsetParent === null) { + return; + } + + this.resize(); + }); + this.fullscreenResizeObserver.observe(this.el); + } + + private destroyFullscreenResizeObserver() { + if (this.fullscreenResizeObserver !== undefined) { + this.fullscreenResizeObserver.disconnect(); + this.fullscreenResizeObserver = undefined; + } } /** diff --git a/core/src/components/content/test/safe-area/content.e2e.ts b/core/src/components/content/test/safe-area/content.e2e.ts new file mode 100644 index 00000000000..f28a872fb1f --- /dev/null +++ b/core/src/components/content/test/safe-area/content.e2e.ts @@ -0,0 +1,194 @@ +import { expect } from '@playwright/test'; +import { configs, test } from '@utils/test/playwright'; + +/** + * ion-content does not have mode-specific styling + */ +configs({ modes: ['md'], directions: ['ltr'] }).forEach(({ title, config }) => { + test.describe(title('content: safe-area'), () => { + test('should keep the scroll region flush with the viewport when the safe area top changes after load', async ({ + page, + }, testInfo) => { + testInfo.annotations.push({ + type: 'issue', + description: 'https://github.com/ionic-team/ionic-framework/issues/31337', + }); + + await page.setContent( + ` + + + + + Header + + + + +

Content

+
+
+ `, + config + ); + + const scrollRegion = page.locator('ion-content .inner-scroll'); + const expectFlushWithTop = () => + expect(async () => { + expect(Math.abs((await scrollRegion.boundingBox())!.y)).toBeLessThanOrEqual(1); + }).toPass({ timeout: 5000 }); + + await expectFlushWithTop(); + + await page.evaluate(() => document.documentElement.style.setProperty('--ion-safe-area-top', '24px')); + + await expectFlushWithTop(); + }); + + test('should keep the scroll region flush with the viewport when the safe area bottom changes after load', async ({ + page, + }, testInfo) => { + testInfo.annotations.push({ + type: 'issue', + description: 'https://github.com/ionic-team/ionic-framework/issues/31337', + }); + + await page.setContent( + ` + + + +

Content

+
+ + + + Footer + + +
+ `, + config + ); + + const scrollRegion = page.locator('ion-content .inner-scroll'); + const viewportHeight = page.viewportSize()!.height; + const expectFlushWithBottom = () => + expect(async () => { + const box = (await scrollRegion.boundingBox())!; + expect(Math.abs(box.y + box.height - viewportHeight)).toBeLessThanOrEqual(1); + }).toPass({ timeout: 5000 }); + + await expectFlushWithBottom(); + + await page.evaluate(() => document.documentElement.style.setProperty('--ion-safe-area-bottom', '24px')); + + await expectFlushWithBottom(); + }); + + test('should recompute the offsets when fullscreen is enabled after load', async ({ page }) => { + await page.setContent( + ` + + + + Header + + + + +

Content

+
+
+ `, + config + ); + + const content = page.locator('ion-content'); + const scrollRegion = page.locator('ion-content .inner-scroll'); + const expectFlushWithTop = () => + expect(async () => { + expect(Math.abs((await scrollRegion.boundingBox())!.y)).toBeLessThanOrEqual(1); + }).toPass({ timeout: 5000 }); + + await content.evaluate((el: HTMLIonContentElement) => (el.fullscreen = true)); + await expectFlushWithTop(); + + // Only the observer created by the fullscreen watcher can catch this. + await page.evaluate(() => document.documentElement.style.setProperty('--ion-safe-area-top', '24px')); + + await expectFlushWithTop(); + }); + + test('should leave the offsets at zero when fullscreen is disabled after load', async ({ page }) => { + await page.setContent( + ` + + + + Header + + + + +

Content

+
+
+ `, + config + ); + + const content = page.locator('ion-content'); + const offsetTop = () => content.evaluate((el) => el.style.getPropertyValue('--offset-top')); + + await content.evaluate((el: HTMLIonContentElement) => (el.fullscreen = false)); + + await expect(async () => { + expect(await offsetTop()).toBe('0px'); + }).toPass({ timeout: 5000 }); + + await page.evaluate(() => document.documentElement.style.setProperty('--ion-safe-area-top', '24px')); + await page.waitForTimeout(300); + + expect(await offsetTop()).toBe('0px'); + }); + + test('should keep the offsets while the page is hidden', async ({ page }) => { + await page.setContent( + ` + +
+ + + Header + + + + +

Content

+
+
+
+ `, + config + ); + + const content = page.locator('ion-content'); + const scrollRegion = page.locator('ion-content .inner-scroll'); + const offsetTop = () => content.evaluate((el) => el.style.getPropertyValue('--offset-top')); + + await expect(async () => { + expect(Math.abs((await scrollRegion.boundingBox())!.y)).toBeLessThanOrEqual(1); + }).toPass({ timeout: 5000 }); + + const beforeHiding = await offsetTop(); + expect(beforeHiding).toBe(`${Math.round((await page.locator('ion-header').boundingBox())!.height)}px`); + + await page.evaluate(() => document.getElementById('page')!.classList.add('ion-page-hidden')); + // Long enough that a missed visibility guard would have committed by now. + await page.waitForTimeout(300); + + expect(await offsetTop()).toBe(beforeHiding); + }); + }); +}); diff --git a/core/src/components/datetime-button/test/overlays/datetime-button.e2e.ts b/core/src/components/datetime-button/test/overlays/datetime-button.e2e.ts index a626dd90855..16050dbbf1b 100644 --- a/core/src/components/datetime-button/test/overlays/datetime-button.e2e.ts +++ b/core/src/components/datetime-button/test/overlays/datetime-button.e2e.ts @@ -1,6 +1,6 @@ import type { Locator } from '@playwright/test'; import { expect } from '@playwright/test'; -import type { EventSpy } from '@utils/test/playwright'; +import type { E2EPage, EventSpy } from '@utils/test/playwright'; import { configs, test } from '@utils/test/playwright'; /** @@ -207,3 +207,108 @@ configs({ modes: ['md'], directions: ['ltr'] }).forEach(({ title, config }) => { }); }); }); + +/** + * This behavior does not vary across modes/directions + */ +configs({ modes: ['md'], directions: ['ltr'] }).forEach(({ title, config }) => { + test.describe(title('datetime-button: reopening modal'), () => { + let datetime: Locator; + let modal: Locator; + let monthYear: Locator; + let ionModalDidPresent: EventSpy; + let ionModalDidDismiss: EventSpy; + + test.beforeEach(async ({ page }) => { + await page.setContent( + ` + + + + + + `, + config + ); + + datetime = page.locator('ion-datetime'); + modal = page.locator('ion-modal'); + monthYear = datetime.locator('.calendar-month-year'); + ionModalDidPresent = await page.spyOnEvent('ionModalDidPresent'); + ionModalDidDismiss = await page.spyOnEvent('ionModalDidDismiss'); + }); + + const openModal = async (page: E2EPage) => { + await page.click('#date-button'); + await ionModalDidPresent.next(); + await page.locator('ion-datetime.datetime-ready').waitFor(); + await page.waitForChanges(); + }; + + const dismissModal = async () => { + await modal.evaluate((el: HTMLIonModalElement) => el.dismiss()); + await ionModalDidDismiss.next(); + }; + + test('should keep the selected day in view when reopened', async ({ page }, testInfo) => { + testInfo.annotations.push({ + type: 'issue', + description: 'https://github.com/ionic-team/ionic-framework/issues/31155', + }); + + const selectedDay = datetime.locator('.calendar-day-active'); + + await openModal(page); + await expect(selectedDay).toBeInViewport(); + + await dismissModal(); + await openModal(page); + + await expect(selectedDay).toBeInViewport(); + }); + + test('should navigate to the previous month when reopened', async ({ page }, testInfo) => { + testInfo.annotations.push({ + type: 'issue', + description: 'https://github.com/ionic-team/ionic-framework/issues/31155', + }); + + await openModal(page); + await dismissModal(); + await openModal(page); + + await expect(monthYear).toHaveText('March 2022'); + + await datetime.locator('.calendar-next-prev ion-button').first().click(); + + await expect(monthYear).toHaveText('February 2022'); + }); + + test('should select a day from the month shown in the header when reopened', async ({ page }, testInfo) => { + testInfo.annotations.push({ + type: 'issue', + description: 'https://github.com/ionic-team/ionic-framework/issues/31155', + }); + + await openModal(page); + await dismissModal(); + await openModal(page); + + await expect(monthYear).toHaveText('March 2022'); + + const ionChange = await page.spyOnEvent('ionChange'); + + /** + * Click the middle of the calendar instead of a day by name so Playwright + * doesn't scroll the target into view and hide a wrong scroll position. + */ + const calendarBody = (await datetime.locator('.calendar-body').boundingBox())!; + await page.mouse.click(calendarBody.x + calendarBody.width / 2, calendarBody.y + calendarBody.height / 2); + await ionChange.next(); + + const value = await datetime.evaluate((el: HTMLIonDatetimeElement) => el.value as string); + expect(value).toMatch(/^2022-03-/); + await expect(monthYear).toHaveText('March 2022'); + }); + }); +}); diff --git a/core/src/components/datetime/datetime.tsx b/core/src/components/datetime/datetime.tsx index 6e5446c04c7..4613befccac 100644 --- a/core/src/components/datetime/datetime.tsx +++ b/core/src/components/datetime/datetime.tsx @@ -140,6 +140,10 @@ export class Datetime implements ComponentInterface { * Set true only by `visibleCallback`. Lets `hiddenCallback` ignore the * synthetic "not intersecting" entry IntersectionObserver fires on * `observe()` when the host mounts offscreen. + * + * Don't reset this in `disconnectedCallback`. Overlays disconnect and + * reconnect the host without re-creating the observers, so a reset there + * makes `hiddenCallback` miss the dismissal. */ private hasBeenIntersecting = false; @@ -179,7 +183,7 @@ export class Datetime implements ComponentInterface { /** * The color to use from your application's color palette. * Default options are: `"primary"`, `"secondary"`, `"tertiary"`, `"success"`, `"warning"`, `"danger"`, `"light"`, `"medium"`, and `"dark"`. - * For more information on colors, see [theming](/docs/theming/basics). + * For more information on colors, refer to [theming](/docs/theming/basics). */ @Prop() color?: Color; @@ -1116,7 +1120,6 @@ export class Datetime implements ComponentInterface { this.clearFocusVisible = undefined; } this.loadTimeoutCleanup(); - this.hasBeenIntersecting = false; } /** diff --git a/core/src/components/modal/gestures/sheet.ts b/core/src/components/modal/gestures/sheet.ts index 39e8e112fe5..5040271018a 100644 --- a/core/src/components/modal/gestures/sheet.ts +++ b/core/src/components/modal/gestures/sheet.ts @@ -7,7 +7,7 @@ import type { Animation, ModalDragEventDetail } from '../../../interface'; import type { GestureDetail } from '../../../utils/gesture'; import { getBackdropValueForSheet } from '../utils'; -import { calculateSpringStep, handleCanDismiss } from './utils'; +import { calculateSpringStep, canSwipeOnContent, handleCanDismiss } from './utils'; export interface MoveSheetToBreakpointOptions { /** @@ -82,6 +82,8 @@ export const createSheetGesture = ( }; const contentEl = baseEl.querySelector('ion-content'); + // Cache the initial value so the gesture restores it instead of forcing scrolling on. + const initialContentScrollY = contentEl?.scrollY ?? true; const height = wrapperEl.clientHeight; let currentBreakpoint = initialBreakpoint; let offset = 0; @@ -261,9 +263,6 @@ export const createSheetGesture = ( const canStart = (detail: GestureDetail) => { /** - * If we are swiping on the content, swiping should only be possible if the content - * is scrolled all the way to the top so that we do not interfere with scrolling. - * * We cannot assume that the `ion-content` target will remain consistent between swipes. * For example, when using ion-nav within a modal it is possible to swipe, push a view, * and then swipe again. The target content will not be the same between swipes. @@ -272,27 +271,11 @@ export const createSheetGesture = ( currentBreakpoint = getCurrentBreakpoint(); /** - * If `expandToScroll` is disabled, we should not allow the swipe gesture - * to start if the content is not scrolled to the top. + * Upwards swipes on the content cannot move the sheet anyway, so this only + * blocks swiping the sheet down from the content. */ - if (!expandToScroll && contentEl) { - const scrollEl = isIonContent(contentEl) ? getElementRoot(contentEl).querySelector('.inner-scroll') : contentEl; - return scrollEl!.scrollTop === 0; - } - - if (currentBreakpoint === 1 && contentEl) { - /** - * The modal should never swipe to close on the content with a refresher. - * Note 1: We cannot solve this by making this gesture have a higher priority than - * the refresher gesture as the iOS native refresh gesture uses a scroll listener in - * addition to a gesture. - * - * Note 2: Do not use getScrollElement here because we need this to be a synchronous - * operation, and getScrollElement is asynchronous. - */ - const scrollEl = isIonContent(contentEl) ? getElementRoot(contentEl).querySelector('.inner-scroll') : contentEl; - const hasRefresherInContent = !!contentEl.querySelector('ion-refresher'); - return !hasRefresherInContent && scrollEl!.scrollTop === 0; + if (contentEl && (!expandToScroll || currentBreakpoint === 1)) { + return canSwipeOnContent(contentEl); } return true; @@ -578,14 +561,14 @@ export const createSheetGesture = ( } /** - * Enables scrolling immediately if the sheet is about to fully expand - * or if it allows scrolling at any breakpoint. Without this, there would + * Restores the content's scroll setting immediately if the sheet is about to + * fully expand or if it allows scrolling at any breakpoint. Without this, there would * be a ~500ms delay while the modal animation completes, causing a * noticeable lag. Native iOS allows scrolling as soon as the gesture is * released, so we align with that behavior. */ if (contentEl && (snapToBreakpoint === breakpoints[breakpoints.length - 1] || !expandToScroll)) { - contentEl.scrollY = true; + contentEl.scrollY = initialContentScrollY; } /** @@ -784,8 +767,20 @@ export const createSheetGesture = ( onEnd, }); + /** + * Puts the content back the way the app declared it. A sheet can dismiss + * without going through moveSheetToBreakpoint, and an inline modal reuses + * the same element on the next present. + */ + const resetContentScroll = () => { + if (contentEl) { + contentEl.scrollY = initialContentScrollY; + } + }; + return { gesture, moveSheetToBreakpoint, + resetContentScroll, }; }; diff --git a/core/src/components/modal/gestures/swipe-to-close.ts b/core/src/components/modal/gestures/swipe-to-close.ts index 7503069fb9b..2dc8d627764 100644 --- a/core/src/components/modal/gestures/swipe-to-close.ts +++ b/core/src/components/modal/gestures/swipe-to-close.ts @@ -1,7 +1,7 @@ import { getTimeGivenProgression } from '@utils/animation/cubic-bezier'; import { isIonContent, findClosestIonContent, disableContentScrollY, resetContentScrollY } from '@utils/content'; import { createGesture } from '@utils/gesture'; -import { clamp, getElementRoot } from '@utils/helpers'; +import { clamp } from '@utils/helpers'; import { OVERLAY_GESTURE_PRIORITY } from '@utils/overlays'; import type { Animation, ModalDragEventDetail } from '../../../interface'; @@ -9,7 +9,7 @@ import type { GestureDetail } from '../../../utils/gesture'; import type { Style as StatusBarStyle } from '../../../utils/native/status-bar'; import { setCardStatusBarDark, setCardStatusBarDefault } from '../utils'; -import { calculateSpringStep, handleCanDismiss } from './utils'; +import { calculateSpringStep, canSwipeOnContent, handleCanDismiss } from './utils'; // Defaults for the card swipe animation export const SwipeToCloseDefaults = { @@ -35,7 +35,6 @@ export const createSwipeToCloseGesture = ( let isOpen = false; let canDismissBlocksGesture = false; let contentEl: HTMLElement | null = null; - let scrollEl: HTMLElement | null = null; const canDismissMaxStep = 0.2; let initialScrollY = true; let lastStep = 0; @@ -60,12 +59,6 @@ export const createSwipeToCloseGesture = ( } /** - * If we are swiping on the content, - * swiping should only be possible if - * the content is scrolled all the way - * to the top so that we do not interfere - * with scrolling. - * * We cannot assume that the `ion-content` * target will remain consistent between * swipes. For example, when using @@ -76,29 +69,7 @@ export const createSwipeToCloseGesture = ( */ contentEl = findClosestIonContent(target); if (contentEl) { - /** - * The card should never swipe to close - * on the content with a refresher. - * Note: We cannot solve this by making the - * swipeToClose gesture have a higher priority - * than the refresher gesture as the iOS native - * refresh gesture uses a scroll listener in - * addition to a gesture. - * - * Note: Do not use getScrollElement here - * because we need this to be a synchronous - * operation, and getScrollElement is - * asynchronous. - */ - if (isIonContent(contentEl)) { - const root = getElementRoot(contentEl); - scrollEl = root.querySelector('.inner-scroll'); - } else { - scrollEl = contentEl; - } - - const hasRefresherInContent = !!contentEl.querySelector('ion-refresher'); - return !hasRefresherInContent && scrollEl!.scrollTop === 0; + return canSwipeOnContent(contentEl); } /** diff --git a/core/src/components/modal/gestures/utils.ts b/core/src/components/modal/gestures/utils.ts index 694227d630d..270341719a8 100644 --- a/core/src/components/modal/gestures/utils.ts +++ b/core/src/components/modal/gestures/utils.ts @@ -1,7 +1,26 @@ +import { findRefresherInContent, isIonContent } from '@utils/content'; +import { getElementRoot } from '@utils/helpers'; import { GESTURE } from '@utils/overlays'; import type { Animation } from '../../../interface'; +/** + * Swiping is only possible when the content is scrolled to the top, so that we + * do not interfere with scrolling, and never on content with a refresher. + * + * Note: We cannot solve the refresher case with gesture priority as the iOS + * native refresh gesture uses a scroll listener in addition to a gesture. + * + * Note: Do not use `getScrollElement` here because we need this to be a + * synchronous operation, and `getScrollElement` is asynchronous. + */ +export const canSwipeOnContent = (contentEl: HTMLElement) => { + const scrollEl = isIonContent(contentEl) ? getElementRoot(contentEl).querySelector('.inner-scroll') : contentEl; + const hasRefresherInContent = !!findRefresherInContent(contentEl); + + return !hasRefresherInContent && scrollEl!.scrollTop === 0; +}; + export const handleCanDismiss = async (el: HTMLIonModalElement, animation: Animation) => { /** * If canDismiss is not a function diff --git a/core/src/components/modal/modal.tsx b/core/src/components/modal/modal.tsx index fbf8a6f3feb..75900bdb361 100644 --- a/core/src/components/modal/modal.tsx +++ b/core/src/components/modal/modal.tsx @@ -51,6 +51,7 @@ import { applySafeAreaOverrides, clearSafeAreaOverrides, getRootSafeAreaTop, + onRootSafeAreaTopChange, hasCustomModalDimensions, type ModalSafeAreaContext, } from './safe-area-utils'; @@ -94,6 +95,7 @@ export class Modal implements ComponentInterface, OverlayInterface { private sortedBreakpoints?: number[]; private keyboardOpenCallback?: () => void; private moveSheetToBreakpoint?: (options: MoveSheetToBreakpointOptions) => Promise; + private resetSheetContentScroll?: () => void; private inheritedAttributes: Attributes = {}; private statusBarStyle?: StatusBarStyle; @@ -110,6 +112,7 @@ export class Modal implements ComponentInterface, OverlayInterface { private currentViewIsPortrait?: boolean; private viewTransitionAnimation?: Animation; private resizeTimeout?: any; + private unsubscribeRootSafeAreaTop?: () => void; // Mutation observer to watch for parent removal private parentRemovalObserver?: MutationObserver; @@ -792,7 +795,7 @@ export class Modal implements ComponentInterface, OverlayInterface { ani.progressStart(true, 1); - const { gesture, moveSheetToBreakpoint } = createSheetGesture( + const { gesture, moveSheetToBreakpoint, resetContentScroll } = createSheetGesture( this.el, this.backdropEl!, wrapperEl, @@ -816,6 +819,7 @@ export class Modal implements ComponentInterface, OverlayInterface { this.gesture = gesture; this.moveSheetToBreakpoint = moveSheetToBreakpoint; + this.resetSheetContentScroll = resetContentScroll; this.gesture.enable(true); @@ -1042,6 +1046,13 @@ export class Modal implements ComponentInterface, OverlayInterface { if (this.gesture) { this.gesture.destroy(); } + /** + * The sheet gesture turns content scrolling off while the sheet sits below + * the top breakpoint. Inline modals reuse the same content on the next + * present, so hand it back before the gesture goes away. + */ + this.resetSheetContentScroll?.(); + this.resetSheetContentScroll = undefined; this.cleanupViewTransitionListener(); this.cleanupParentRemovalObserver(); this.cleanupSafeAreaOverrides(); @@ -1484,17 +1495,21 @@ export class Modal implements ComponentInterface, OverlayInterface { // Set the internal offset property with the resolved root safe-area-top value if (context.isSheetModal) { this.updateSheetOffsetTop(); + this.unsubscribeRootSafeAreaTop = onRootSafeAreaTopChange((safeAreaTop) => + this.updateSheetOffsetTop(safeAreaTop) + ); } } /** - * Resolves the current root --ion-safe-area-top value and sets the - * internal --ion-modal-offset-top property on the host element. - * Called on present and on resize (e.g., device rotation changes safe-area). + * Sets the internal --ion-modal-offset-top property on the host element, + * resolving the current root --ion-safe-area-top when no value is given. + * Called on present, on resize (e.g., device rotation changes safe-area), + * and whenever the root safe-area value itself changes. */ - private updateSheetOffsetTop(): void { - const safeAreaTop = getRootSafeAreaTop(); - this.el.style.setProperty('--ion-modal-offset-top', `${safeAreaTop}px`); + private updateSheetOffsetTop(safeAreaTop?: number): void { + const value = safeAreaTop ?? getRootSafeAreaTop(); + this.el.style.setProperty('--ion-modal-offset-top', `${value}px`); } /** @@ -1597,6 +1612,9 @@ export class Modal implements ComponentInterface, OverlayInterface { private cleanupSafeAreaOverrides(): void { clearSafeAreaOverrides(this.el); + this.unsubscribeRootSafeAreaTop?.(); + this.unsubscribeRootSafeAreaTop = undefined; + // Remove internal sheet offset property this.el.style.removeProperty('--ion-modal-offset-top'); diff --git a/core/src/components/modal/safe-area-utils.ts b/core/src/components/modal/safe-area-utils.ts index 59ae3a4fdb5..b06b2315b63 100644 --- a/core/src/components/modal/safe-area-utils.ts +++ b/core/src/components/modal/safe-area-utils.ts @@ -104,6 +104,45 @@ export const getRootSafeAreaTop = (): number => { return value; }; +/** + * Calls back when the resolved root `--ion-safe-area-top` changes, which no + * event and no window resize covers. The probe's height tracks the variable, so + * a change to it becomes a size change the observer can see. + */ +export const onRootSafeAreaTopChange = (callback: (safeAreaTop: number) => void): (() => void) => { + const doc = win?.document; + if (!doc?.body || typeof ResizeObserver === 'undefined') { + return () => undefined; + } + + const probe = doc.createElement('div'); + probe.style.cssText = + 'position:fixed;visibility:hidden;pointer-events:none;top:0;left:0;width:0;' + + 'height:var(--ion-safe-area-top,0px);'; + doc.body.appendChild(probe); + + /** + * Seeded with the value the caller has already applied, so a change that + * lands before the observer's first delivery still gets reported. Comparing + * against an unset value instead would consume that first delivery and treat + * the new inset as the baseline. + */ + let lastHeight = getRootSafeAreaTop(); + const observer = new ResizeObserver((entries) => { + const { height } = entries[0].contentRect; + if (height !== lastHeight) { + lastHeight = height; + callback(height); + } + }); + observer.observe(probe); + + return () => { + observer.disconnect(); + probe.remove(); + }; +}; + /** * True when the modal host declares BOTH a non-fullscreen `--width` AND a * non-fullscreen `--height` (i.e. a centered-dialog-like modal that doesn't diff --git a/core/src/components/modal/test/refresher-scroll-target/index.html b/core/src/components/modal/test/refresher-scroll-target/index.html new file mode 100644 index 00000000000..12206de68df --- /dev/null +++ b/core/src/components/modal/test/refresher-scroll-target/index.html @@ -0,0 +1,136 @@ + + + + + Modal - Refresher with Custom Scroll Target + + + + + + + + + + + + + + + +
+ + + Refresher with Custom Scroll Target + + + + + + + + + + +
+
+ + + + diff --git a/core/src/components/modal/test/refresher-scroll-target/modal.e2e.ts b/core/src/components/modal/test/refresher-scroll-target/modal.e2e.ts new file mode 100644 index 00000000000..c2950ec5e03 --- /dev/null +++ b/core/src/components/modal/test/refresher-scroll-target/modal.e2e.ts @@ -0,0 +1,189 @@ +import { expect } from '@playwright/test'; +import type { E2EPage } from '@utils/test/playwright'; +import { configs, dragElementByYAxis, test } from '@utils/test/playwright'; + +const dragDownOnScrollHost = async (page: E2EPage, dragByY = 250) => { + // The refresher creates its gesture asynchronously, so wait for it to hydrate. + await page.locator('ion-modal ion-refresher.hydrated').waitFor({ state: 'attached' }); + + const scrollHost = page.locator('ion-modal .ion-content-scroll-host'); + const box = (await scrollHost.boundingBox())!; + + // Start near the top of the host so the drag stays within smaller viewports. + await dragElementByYAxis(scrollHost, page, dragByY, box.y + 5); +}; + +/** + * This behavior does not vary across directions. + */ +configs({ directions: ['ltr'] }).forEach(({ title, config }) => { + test.describe(title('sheet modal: refresher with custom scroll target'), () => { + test.beforeEach(async ({ page }) => { + await page.goto('/src/components/modal/test/refresher-scroll-target', config); + }); + + test('should refresh instead of dismissing when pulling down on the custom scroll target', async ({ + page, + }, testInfo) => { + testInfo.annotations.push({ + type: 'issue', + description: 'https://github.com/ionic-team/ionic-framework/issues/31332', + }); + + const ionModalDidPresent = await page.spyOnEvent('ionModalDidPresent'); + const ionModalDidDismiss = await page.spyOnEvent('ionModalDidDismiss'); + const ionRefresh = await page.spyOnEvent('ionRefresh'); + + await page.click('#sheet'); + await ionModalDidPresent.next(); + + await dragDownOnScrollHost(page); + + await ionRefresh.next(); + expect(ionModalDidDismiss).toHaveReceivedEventTimes(0); + }); + + test('should refresh instead of dismissing when expandToScroll is disabled', async ({ page }, testInfo) => { + testInfo.annotations.push({ + type: 'issue', + description: 'https://github.com/ionic-team/ionic-framework/issues/31332', + }); + + const ionModalDidPresent = await page.spyOnEvent('ionModalDidPresent'); + const ionModalDidDismiss = await page.spyOnEvent('ionModalDidDismiss'); + const ionRefresh = await page.spyOnEvent('ionRefresh'); + + await page.click('#sheet-no-expand'); + await ionModalDidPresent.next(); + + await dragDownOnScrollHost(page); + + await ionRefresh.next(); + expect(ionModalDidDismiss).toHaveReceivedEventTimes(0); + }); + + test('should move the sheet rather than refresh when dragging the content at a partial breakpoint', async ({ + page, + }) => { + const ionModalDidPresent = await page.spyOnEvent('ionModalDidPresent'); + const ionBreakpointDidChange = await page.spyOnEvent('ionBreakpointDidChange'); + const ionRefresh = await page.spyOnEvent('ionRefresh'); + + await page.click('#sheet-breakpoints'); + await ionModalDidPresent.next(); + + await dragDownOnScrollHost(page); + + await ionBreakpointDidChange.next(); + expect(ionRefresh).toHaveReceivedEventTimes(0); + }); + + test('should refresh rather than move the sheet at a partial breakpoint when expandToScroll is disabled', async ({ + page, + }) => { + const ionModalDidPresent = await page.spyOnEvent('ionModalDidPresent'); + const ionBreakpointDidChange = await page.spyOnEvent('ionBreakpointDidChange'); + const ionRefresh = await page.spyOnEvent('ionRefresh'); + + await page.click('#sheet-breakpoints-no-expand'); + await ionModalDidPresent.next(); + + await dragDownOnScrollHost(page); + + await ionRefresh.next(); + expect(ionBreakpointDidChange).toHaveReceivedEventTimes(0); + }); + + test('should keep the content opted out of scrolling after the sheet snaps back', async ({ page }, testInfo) => { + testInfo.annotations.push({ + type: 'issue', + description: 'https://github.com/ionic-team/ionic-framework/issues/31332', + }); + + const ionModalDidPresent = await page.spyOnEvent('ionModalDidPresent'); + const ionBreakpointDidChange = await page.spyOnEvent('ionBreakpointDidChange'); + const ionRefresh = await page.spyOnEvent('ionRefresh'); + + await page.click('#sheet-breakpoints'); + await ionModalDidPresent.next(); + + const content = page.locator('ion-modal ion-content'); + await expect(content).toHaveJSProperty('scrollY', false); + + /** + * Expanding to the top breakpoint is what used to force scrolling back on. + * Waiting on the breakpoint change also proves the drag moved the sheet, so + * this cannot pass by leaving the content untouched. + */ + const wrapper = (await page.locator('ion-modal .modal-wrapper').boundingBox())!; + await dragElementByYAxis(page.locator('ion-modal .modal-handle'), page, -Math.round(wrapper.height * 0.3)); + await ionBreakpointDidChange.next(); + + await expect(content).toHaveJSProperty('scrollY', false); + + await dragDownOnScrollHost(page); + + await ionRefresh.next(); + }); + + test('should keep the content opted out of scrolling when expandToScroll is disabled', async ({ page }) => { + const ionModalDidPresent = await page.spyOnEvent('ionModalDidPresent'); + + await page.click('#sheet-breakpoints-no-expand'); + await ionModalDidPresent.next(); + + const content = page.locator('ion-modal ion-content'); + await expect(content).toHaveJSProperty('scrollY', false); + + // With expandToScroll disabled the sheet restores scrolling at every breakpoint. + await dragElementByYAxis(page.locator('ion-modal .modal-handle'), page, 60); + + await expect(content).toHaveJSProperty('scrollY', false); + }); + + test('should still dismiss when dragging the handle', async ({ page }) => { + const ionModalDidPresent = await page.spyOnEvent('ionModalDidPresent'); + const ionModalDidDismiss = await page.spyOnEvent('ionModalDidDismiss'); + + await page.click('#sheet-no-expand'); + await ionModalDidPresent.next(); + + await dragElementByYAxis(page.locator('ion-modal .modal-handle'), page, 500); + + await ionModalDidDismiss.next(); + }); + }); +}); + +/** + * Card modals are only available in iOS mode. + * This behavior does not vary across directions. + */ +configs({ modes: ['ios'], directions: ['ltr'] }).forEach(({ title, config }) => { + test.describe(title('card modal: refresher with custom scroll target'), () => { + test.beforeEach(async ({ page }) => { + await page.goto('/src/components/modal/test/refresher-scroll-target', config); + }); + + test('should refresh instead of dismissing when pulling down on the custom scroll target', async ({ + page, + }, testInfo) => { + testInfo.annotations.push({ + type: 'issue', + description: 'https://github.com/ionic-team/ionic-framework/issues/31332', + }); + + const ionModalDidPresent = await page.spyOnEvent('ionModalDidPresent'); + const ionModalDidDismiss = await page.spyOnEvent('ionModalDidDismiss'); + const ionRefresh = await page.spyOnEvent('ionRefresh'); + + await page.click('#card'); + await ionModalDidPresent.next(); + + await dragDownOnScrollHost(page); + + await ionRefresh.next(); + expect(ionModalDidDismiss).toHaveReceivedEventTimes(0); + }); + }); +}); diff --git a/core/src/components/modal/test/safe-area/modal.e2e.ts b/core/src/components/modal/test/safe-area/modal.e2e.ts index 8f13349fe95..e247b174956 100644 --- a/core/src/components/modal/test/safe-area/modal.e2e.ts +++ b/core/src/components/modal/test/safe-area/modal.e2e.ts @@ -257,6 +257,62 @@ configs({ modes: ['ios', 'md'], directions: ['ltr'] }).forEach(({ title, config expect(offsetTop).toBe(`${TEST_SAFE_AREA_TOP}px`); }); + test('sheet modal should update --ion-modal-offset-top when the safe area top changes after present', async ({ + page, + }, testInfo) => { + testInfo.annotations.push({ + type: 'issue', + description: 'https://github.com/ionic-team/ionic-framework/issues/31337', + }); + + const ionModalDidPresent = await page.spyOnEvent('ionModalDidPresent'); + + await page.click('#sheet-modal'); + await ionModalDidPresent.next(); + + const modal = page.locator('ion-modal'); + const offsetTop = () => + modal.evaluate((el: HTMLIonModalElement) => el.style.getPropertyValue('--ion-modal-offset-top')); + + expect(await offsetTop()).toBe(`${TEST_SAFE_AREA_TOP}px`); + + await page.evaluate(() => document.documentElement.style.setProperty('--ion-safe-area-top', '24px')); + + await expect(async () => { + expect(await offsetTop()).toBe('24px'); + }).toPass({ timeout: 5000 }); + }); + + /** + * Covers a sheet presented before the inset is known, which is the Android + * edge-to-edge startup order rather than the 47px the test page declares. + */ + test('sheet modal should pick up the safe area top when it starts at zero', async ({ page }, testInfo) => { + testInfo.annotations.push({ + type: 'issue', + description: 'https://github.com/ionic-team/ionic-framework/issues/31337', + }); + + await page.evaluate(() => document.documentElement.style.setProperty('--ion-safe-area-top', '0px')); + + const ionModalDidPresent = await page.spyOnEvent('ionModalDidPresent'); + + await page.click('#sheet-modal'); + await ionModalDidPresent.next(); + + const modal = page.locator('ion-modal'); + const offsetTop = () => + modal.evaluate((el: HTMLIonModalElement) => el.style.getPropertyValue('--ion-modal-offset-top')); + + expect(await offsetTop()).toBe('0px'); + + await page.evaluate(() => document.documentElement.style.setProperty('--ion-safe-area-top', '24px')); + + await expect(async () => { + expect(await offsetTop()).toBe('24px'); + }).toPass({ timeout: 5000 }); + }); + test('fullscreen modal safe-area should update on resize from phone to tablet', async ({ page }, testInfo) => { testInfo.annotations.push({ type: 'issue', diff --git a/core/src/components/modal/test/sheet/modal.e2e.ts b/core/src/components/modal/test/sheet/modal.e2e.ts index 7e127bc39ab..084ac9fd19b 100644 --- a/core/src/components/modal/test/sheet/modal.e2e.ts +++ b/core/src/components/modal/test/sheet/modal.e2e.ts @@ -127,6 +127,20 @@ configs({ modes: ['ios'], directions: ['ltr'] }).forEach(({ title, config }) => expect(breakpoint).toBe(0.5); }); + test('should give scrolling back to the content when expanded to the top breakpoint', async ({ page }) => { + const ionBreakpointDidChange = await page.spyOnEvent('ionBreakpointDidChange'); + const modal = page.locator('.modal-sheet'); + const content = modal.locator('ion-content'); + + // The sheet starts partially open, so the content doesn't scroll yet. + await expect(content).toHaveJSProperty('scrollY', false); + + await modal.evaluate((el: HTMLIonModalElement) => el.setCurrentBreakpoint(1)); + await ionBreakpointDidChange.next(); + + await expect(content).toHaveJSProperty('scrollY', true); + }); + test('should emit ionBreakpointDidChange', async ({ page }) => { const ionBreakpointDidChange = await page.spyOnEvent('ionBreakpointDidChange'); const modal = page.locator('.modal-sheet'); @@ -157,6 +171,61 @@ configs({ modes: ['ios'], directions: ['ltr'] }).forEach(({ title, config }) => }); }); + test('it should restore content scrolling on dismiss so a reused modal still scrolls', async ({ page }) => { + await page.goto('/src/components/modal/test/sheet', config); + + await page.setContent( + ` + + Open + + + Dismiss + + + + + `, + config + ); + + const modal = page.locator('ion-modal'); + const content = modal.locator('ion-content'); + const openButton = page.locator('#open-modal'); + const dismissButton = page.locator('#dismiss'); + + const ionModalDidPresent = await page.spyOnEvent('ionModalDidPresent'); + const ionModalDidDismiss = await page.spyOnEvent('ionModalDidDismiss'); + const ionBreakpointDidChange = await page.spyOnEvent('ionBreakpointDidChange'); + + await openButton.click(); + await ionModalDidPresent.next(); + + // Below the top breakpoint, so the sheet has turned content scrolling off. + await expect(content).toHaveJSProperty('scrollY', false); + + await dismissButton.click(); + await ionModalDidDismiss.next(); + + /** + * An inline modal reuses this content on the next present. Leaving it + * switched off means the re-presented sheet reads that as the app's own + * setting and never scrolls again. + */ + await expect(content).toHaveJSProperty('scrollY', true); + + await openButton.click(); + await ionModalDidPresent.next(); + + await modal.evaluate((el: HTMLIonModalElement) => el.setCurrentBreakpoint(1)); + await ionBreakpointDidChange.next(); + + await expect(content).toHaveJSProperty('scrollY', true); + }); + test('it should reset the breakpoint value on dismiss', async ({ page }) => { await page.goto('/src/components/modal/test/sheet', config); test.info().annotations.push({ diff --git a/core/src/components/refresher/refresher.tsx b/core/src/components/refresher/refresher.tsx index be838aa9c4a..ecd27fd0965 100644 --- a/core/src/components/refresher/refresher.tsx +++ b/core/src/components/refresher/refresher.tsx @@ -2,6 +2,7 @@ import type { ComponentInterface, EventEmitter } from '@stencil/core'; import { Component, Element, Event, Host, Method, Prop, State, Watch, h, readTask, writeTask } from '@stencil/core'; import { getTimeGivenProgression } from '@utils/animation/cubic-bezier'; import { + findRefresherScrollHost, getScrollElement, ION_CONTENT_CLASS_SELECTOR, ION_CONTENT_ELEMENT_SELECTOR, @@ -526,7 +527,7 @@ export class Refresher implements ComponentInterface { * or the background content element. */ componentOnReady(contentEl, async () => { - const customScrollTarget = contentEl.querySelector(ION_CONTENT_CLASS_SELECTOR); + const customScrollTarget = findRefresherScrollHost(contentEl); /** * Query the custom scroll target (if available), first. In refresher implementations, * the ion-refresher element will always be a direct child of ion-content (slot="fixed"). By diff --git a/core/src/utils/content/content.utils.spec.ts b/core/src/utils/content/content.utils.spec.ts index a9be0a6139f..95b674b7f02 100644 --- a/core/src/utils/content/content.utils.spec.ts +++ b/core/src/utils/content/content.utils.spec.ts @@ -4,6 +4,7 @@ import { printIonContentErrorMsg, findClosestIonContent, findIonContent, + findRefresherInContent, getScrollElement, } from './index'; @@ -48,6 +49,68 @@ describe('Content Utils', () => { }); }); + describe('findRefresherInContent', () => { + const createContent = ({ hasRefresher = true, scrollHostCount = 0 } = {}) => { + const content = document.createElement('ion-content'); + + if (hasRefresher) { + const refresher = document.createElement('ion-refresher'); + refresher.setAttribute('slot', 'fixed'); + content.appendChild(refresher); + } + + for (let i = 0; i < scrollHostCount; i++) { + const scrollHost = document.createElement('div'); + scrollHost.classList.add('ion-content-scroll-host'); + content.appendChild(scrollHost); + } + + return content; + }; + + it('should find the refresher within ion-content', () => { + const content = createContent(); + + expect(findRefresherInContent(content)).toBe(content.querySelector('ion-refresher')); + }); + + it('should return null when ion-content has no refresher', () => { + const content = createContent({ hasRefresher: false }); + + expect(findRefresherInContent(content)).toBe(null); + }); + + it('should find the refresher from a custom scroll host that is a sibling of it', () => { + const content = createContent({ scrollHostCount: 1 }); + const scrollHost = content.querySelector('.ion-content-scroll-host')!; + + expect(findRefresherInContent(scrollHost)).toBe(content.querySelector('ion-refresher')); + }); + + it('should find the refresher from an element nested within the custom scroll host', () => { + const content = createContent({ scrollHostCount: 1 }); + const nested = document.createElement('div'); + content.querySelector('.ion-content-scroll-host')!.appendChild(nested); + + expect(findRefresherInContent(nested)).toBe(content.querySelector('ion-refresher')); + }); + + it('should return null for a custom scroll host the refresher does not scroll with', () => { + const content = createContent({ scrollHostCount: 2 }); + const secondScrollHost = content.querySelectorAll('.ion-content-scroll-host')[1]; + + expect(findRefresherInContent(secondScrollHost)).toBe(null); + }); + + it('should return null for a custom scroll host that is not within an ion-content', () => { + const scrollHost = document.createElement('div'); + scrollHost.classList.add('ion-content-scroll-host'); + scrollHost.appendChild(document.createElement('ion-refresher')); + + expect(findRefresherInContent(scrollHost)).toBe(null); + }); + }); + describe('scrollToTop', () => { describe('scroll duration is 0', () => { it('should call scrollToTop when the tag name is ion-content', () => { diff --git a/core/src/utils/content/index.ts b/core/src/utils/content/index.ts index 44a6f7bff13..3c4f0967592 100644 --- a/core/src/utils/content/index.ts +++ b/core/src/utils/content/index.ts @@ -58,6 +58,41 @@ export const findClosestIonContent = (el: Element) => { return el.closest(ION_CONTENT_SELECTOR); }; +/** + * Queries the custom scroll host an `ion-refresher` scrolls with in the given + * `ion-content`. A refresher only pairs with the first host. + */ +export const findRefresherScrollHost = (ionContent: Element) => { + return ionContent.querySelector(ION_CONTENT_CLASS_SELECTOR); +}; + +/** + * Queries the `ion-refresher` that scrolls with the given content element, + * which may be an `ion-content` or a custom scroll host. A refresher is a + * `slot="fixed"` child of `ion-content`, so it is a sibling of a scroll host + * rather than a descendant of it. + */ +export const findRefresherInContent = (contentEl: Element) => { + // An `ion-content` owns any refresher inside it, scroll host or not. + if (isIonContent(contentEl)) { + return contentEl.querySelector('ion-refresher'); + } + + // A refresher needs an `ion-content` ancestor to initialize. + const ionContent = contentEl.closest(ION_CONTENT_ELEMENT_SELECTOR); + if (ionContent === null) { + return null; + } + + // Any scroll host other than the refresher's own has no refresher. + const refresherScrollHost = findRefresherScrollHost(ionContent); + if (refresherScrollHost === null || !refresherScrollHost.contains(contentEl)) { + return null; + } + + return ionContent.querySelector('ion-refresher'); +}; + /** * Scrolls to the top of the element. If an `ion-content` is found, it will scroll * using the public API `scrollToTop` with a duration. diff --git a/core/stencil.config.ts b/core/stencil.config.ts index 114ef0889c0..5a88e742760 100644 --- a/core/stencil.config.ts +++ b/core/stencil.config.ts @@ -265,5 +265,11 @@ export const config: Config = { * the default behavior (slated for a future Stencil major version). */ experimentalScopedSlotChanges: true, + /** + * Vite 8 / Rolldown honors the `@vite-ignore` comment on the lazy loader's dynamic import + * and never emits the `.entry.js` chunks, so requests for them 404. This flag prepends a + * switch of literal import paths those bundlers can resolve. + */ + enableImportInjection: true, } }; diff --git a/docs/angular/testing.md b/docs/angular/testing.md index bed8941ea4e..661c014ee1e 100644 --- a/docs/angular/testing.md +++ b/docs/angular/testing.md @@ -93,6 +93,10 @@ Tests for lazy loaded Ionic UI components should only be added under the `/lazy` Tests for standalone Ionic UI components should only be added under the `/standalone` route. This allows for an isolated environment where the lazy loaded `IonicModule` is not initialized. The standalone components use Stencil's custom element bundle instead of the lazy loaded bundle. If `IonicModule` is initialized then the Stencil components will fall back to using the lazy loaded implementation instead of the custom elements bundle implementation. +### Waiting for Ionic Components + +Use the `componentOnReady` helper exported from `@ionic/core` rather than calling `el.componentOnReady()` directly. That method only exists on lazy loaded elements, so a direct call throws under the `/standalone` route. The helper covers both: under `/lazy` it awaits the element's own `componentOnReady()` promise, and under `/standalone` it waits one animation frame, giving the component's inner contents a chance to render. + ## Adding New Test Apps As we add support for new versions of Angular, we will also need to update this directory to test against new applications. The following steps can serve as a guide for adding new apps: diff --git a/docs/react/testing.md b/docs/react/testing.md index 8c7fc56549c..8a6bff42371 100644 --- a/docs/react/testing.md +++ b/docs/react/testing.md @@ -47,6 +47,12 @@ If you want to add a version-specific change, add the change inside of the appro If you need to add E2E tests that are only run on a specific version of the JS Framework, replicate the `VersionTest` component on each partial application. This ensures that tests for framework version X do not get run for framework version Y. +### Testing Ionic Components + +`@ionic/react` imports every component through `defineCustomElement` from `@ionic/core/components`, so every test runs against the custom elements build. + +These test apps are Cypress only, and Cypress retries assertions until they pass, so there is nothing to wait on manually today. If we add unit tests that assert against rendered DOM, use the `componentOnReady` helper exported from `@ionic/core` rather than calling `el.componentOnReady()` directly. That method does not exist on custom elements, so the direct call throws. The helper waits one animation frame instead, giving the component's inner contents a chance to render. + ## Adding New Test Apps As we add support for new versions of React, we will also need to update this directory to test against new applications. The following steps can serve as a guide for adding new apps: diff --git a/docs/vue/testing.md b/docs/vue/testing.md index bf27446bee7..1f4fffdc372 100644 --- a/docs/vue/testing.md +++ b/docs/vue/testing.md @@ -81,6 +81,14 @@ If you want to add a version-specific change, add the change inside of the appro If you need to add E2E tests that are only run on a specific version of the JS Framework, replicate the `VersionTest` component on each partial application. This ensures that tests for framework version X do not get run for framework version Y. +### Testing Ionic Components + +`@ionic/vue` imports every component through `defineCustomElement` from `@ionic/core/components`, so every test runs against the custom elements build. + +These test apps are Cypress only, and Cypress retries assertions until they pass, so there is nothing to wait on manually today. If we add unit tests that assert against rendered DOM, use the `componentOnReady` helper exported from `@ionic/core` rather than calling `el.componentOnReady()` directly. That method does not exist on custom elements, so the direct call throws. The helper waits one animation frame instead, giving the component's inner contents a chance to render. + +When testing Ionic components, use the exported `componentOnReady` helper from `@ionic/core` instead of calling `el.componentOnReady()` directly. The helper works with both lazy-loaded and custom-element builds, making it more likely the component has finished rendering before making assertions against its rendered DOM or running accessibility tests. + ## Adding New Test Apps As we add support for new versions of Vue, we will also need to update this directory to test against new applications. The following steps can serve as a guide for adding new apps: diff --git a/lerna.json b/lerna.json index 62ca22e5aac..cfe9cb7da97 100644 --- a/lerna.json +++ b/lerna.json @@ -10,5 +10,5 @@ "packages/vue", "packages/vue-router" ], - "version": "8.8.17" + "version": "8.8.18" } diff --git a/packages/angular-server/CHANGELOG.md b/packages/angular-server/CHANGELOG.md index 1d575bf7c87..e21d866a157 100644 --- a/packages/angular-server/CHANGELOG.md +++ b/packages/angular-server/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [8.8.18](https://github.com/ionic-team/ionic-framework/compare/v8.8.17...v8.8.18) (2026-08-12) + +**Note:** Version bump only for package @ionic/angular-server + + + + + ## [8.8.17](https://github.com/ionic-team/ionic-framework/compare/v8.8.16...v8.8.17) (2026-08-05) **Note:** Version bump only for package @ionic/angular-server diff --git a/packages/angular-server/package-lock.json b/packages/angular-server/package-lock.json index 11bafd8b5b6..627d526f342 100644 --- a/packages/angular-server/package-lock.json +++ b/packages/angular-server/package-lock.json @@ -1,15 +1,15 @@ { "name": "@ionic/angular-server", - "version": "8.8.17", + "version": "8.8.18", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@ionic/angular-server", - "version": "8.8.17", + "version": "8.8.18", "license": "MIT", "dependencies": { - "@ionic/core": "^8.8.17" + "@ionic/core": "^8.8.18" }, "devDependencies": { "@angular/animations": "^22.0.0", @@ -1135,9 +1135,9 @@ } }, "node_modules/@ionic/core": { - "version": "8.8.17", - "resolved": "https://registry.npmjs.org/@ionic/core/-/core-8.8.17.tgz", - "integrity": "sha512-w4Ya+0EpGqajVbp6c6TMt4u/MX1flmdzpz2gfgXUkRgp/YfFIRw8n6pIZEOv4EzdUzrhhvPVUEZR64w9R5Fguw==", + "version": "8.8.18", + "resolved": "https://registry.npmjs.org/@ionic/core/-/core-8.8.18.tgz", + "integrity": "sha512-QRFqi6gMSTk89FMjtoDx3p6e2dD7mYxqYzS0+Hl+yjxnoWoNFluWKM9rnGEEkdvpY7bF1pt6CI5IwMt+vjYQWg==", "license": "MIT", "dependencies": { "@stencil/core": "4.43.5", @@ -7626,9 +7626,9 @@ "dev": true }, "@ionic/core": { - "version": "8.8.17", - "resolved": "https://registry.npmjs.org/@ionic/core/-/core-8.8.17.tgz", - "integrity": "sha512-w4Ya+0EpGqajVbp6c6TMt4u/MX1flmdzpz2gfgXUkRgp/YfFIRw8n6pIZEOv4EzdUzrhhvPVUEZR64w9R5Fguw==", + "version": "8.8.18", + "resolved": "https://registry.npmjs.org/@ionic/core/-/core-8.8.18.tgz", + "integrity": "sha512-QRFqi6gMSTk89FMjtoDx3p6e2dD7mYxqYzS0+Hl+yjxnoWoNFluWKM9rnGEEkdvpY7bF1pt6CI5IwMt+vjYQWg==", "requires": { "@stencil/core": "4.43.5", "ionicons": "^8.0.13", diff --git a/packages/angular-server/package.json b/packages/angular-server/package.json index 86a0d51c7d5..d4bbae70076 100644 --- a/packages/angular-server/package.json +++ b/packages/angular-server/package.json @@ -1,6 +1,6 @@ { "name": "@ionic/angular-server", - "version": "8.8.17", + "version": "8.8.18", "description": "Angular SSR Module for Ionic", "keywords": [ "ionic", @@ -78,6 +78,6 @@ }, "prettier": "@ionic/prettier-config", "dependencies": { - "@ionic/core": "^8.8.17" + "@ionic/core": "^8.8.18" } } diff --git a/packages/angular/CHANGELOG.md b/packages/angular/CHANGELOG.md index 15b4bd57110..eba40d13271 100644 --- a/packages/angular/CHANGELOG.md +++ b/packages/angular/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [8.8.18](https://github.com/ionic-team/ionic-framework/compare/v8.8.17...v8.8.18) (2026-08-12) + +**Note:** Version bump only for package @ionic/angular + + + + + ## [8.8.17](https://github.com/ionic-team/ionic-framework/compare/v8.8.16...v8.8.17) (2026-08-05) diff --git a/packages/angular/package-lock.json b/packages/angular/package-lock.json index bd619f488db..39dd7cc1a72 100644 --- a/packages/angular/package-lock.json +++ b/packages/angular/package-lock.json @@ -1,15 +1,15 @@ { "name": "@ionic/angular", - "version": "8.8.17", + "version": "8.8.18", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@ionic/angular", - "version": "8.8.17", + "version": "8.8.18", "license": "MIT", "dependencies": { - "@ionic/core": "^8.8.17", + "@ionic/core": "^8.8.18", "ionicons": "^8.0.13", "jsonc-parser": "^3.0.0", "tslib": "^2.3.0" @@ -2036,9 +2036,9 @@ } }, "node_modules/@ionic/core": { - "version": "8.8.17", - "resolved": "https://registry.npmjs.org/@ionic/core/-/core-8.8.17.tgz", - "integrity": "sha512-w4Ya+0EpGqajVbp6c6TMt4u/MX1flmdzpz2gfgXUkRgp/YfFIRw8n6pIZEOv4EzdUzrhhvPVUEZR64w9R5Fguw==", + "version": "8.8.18", + "resolved": "https://registry.npmjs.org/@ionic/core/-/core-8.8.18.tgz", + "integrity": "sha512-QRFqi6gMSTk89FMjtoDx3p6e2dD7mYxqYzS0+Hl+yjxnoWoNFluWKM9rnGEEkdvpY7bF1pt6CI5IwMt+vjYQWg==", "license": "MIT", "dependencies": { "@stencil/core": "4.43.5", diff --git a/packages/angular/package.json b/packages/angular/package.json index 84c60936add..2fe8b252af9 100644 --- a/packages/angular/package.json +++ b/packages/angular/package.json @@ -1,6 +1,6 @@ { "name": "@ionic/angular", - "version": "8.8.17", + "version": "8.8.18", "description": "Angular specific wrappers for @ionic/core", "keywords": [ "ionic", @@ -47,7 +47,7 @@ } }, "dependencies": { - "@ionic/core": "^8.8.17", + "@ionic/core": "^8.8.18", "ionicons": "^8.0.13", "jsonc-parser": "^3.0.0", "tslib": "^2.3.0" diff --git a/packages/docs/CHANGELOG.md b/packages/docs/CHANGELOG.md index a1883d14b8f..36c4332ec5e 100644 --- a/packages/docs/CHANGELOG.md +++ b/packages/docs/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [8.8.18](https://github.com/ionic-team/ionic-framework/compare/v8.8.17...v8.8.18) (2026-08-12) + +**Note:** Version bump only for package @ionic/docs + + + + + ## [8.8.17](https://github.com/ionic-team/ionic-framework/compare/v8.8.16...v8.8.17) (2026-08-05) **Note:** Version bump only for package @ionic/docs diff --git a/packages/docs/package-lock.json b/packages/docs/package-lock.json index 994c44fc16e..195bd3a51b8 100644 --- a/packages/docs/package-lock.json +++ b/packages/docs/package-lock.json @@ -1,12 +1,12 @@ { "name": "@ionic/docs", - "version": "8.8.17", + "version": "8.8.18", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@ionic/docs", - "version": "8.8.17", + "version": "8.8.18", "license": "MIT" } } diff --git a/packages/docs/package.json b/packages/docs/package.json index a2721216842..bfa8999c5af 100644 --- a/packages/docs/package.json +++ b/packages/docs/package.json @@ -1,6 +1,6 @@ { "name": "@ionic/docs", - "version": "8.8.17", + "version": "8.8.18", "description": "Pre-packaged API documentation for the Ionic docs.", "main": "core.json", "types": "core.d.ts", diff --git a/packages/react-router/CHANGELOG.md b/packages/react-router/CHANGELOG.md index 6f655df1f4e..01f78e17712 100644 --- a/packages/react-router/CHANGELOG.md +++ b/packages/react-router/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [8.8.18](https://github.com/ionic-team/ionic-framework/compare/v8.8.17...v8.8.18) (2026-08-12) + +**Note:** Version bump only for package @ionic/react-router + + + + + ## [8.8.17](https://github.com/ionic-team/ionic-framework/compare/v8.8.16...v8.8.17) (2026-08-05) diff --git a/packages/react-router/package-lock.json b/packages/react-router/package-lock.json index e04b961df82..2784bb82416 100644 --- a/packages/react-router/package-lock.json +++ b/packages/react-router/package-lock.json @@ -1,15 +1,15 @@ { "name": "@ionic/react-router", - "version": "8.8.17", + "version": "8.8.18", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@ionic/react-router", - "version": "8.8.17", + "version": "8.8.18", "license": "MIT", "dependencies": { - "@ionic/react": "^8.8.17", + "@ionic/react": "^8.8.18", "tslib": "*" }, "devDependencies": { @@ -250,9 +250,9 @@ } }, "node_modules/@ionic/core": { - "version": "8.8.17", - "resolved": "https://registry.npmjs.org/@ionic/core/-/core-8.8.17.tgz", - "integrity": "sha512-w4Ya+0EpGqajVbp6c6TMt4u/MX1flmdzpz2gfgXUkRgp/YfFIRw8n6pIZEOv4EzdUzrhhvPVUEZR64w9R5Fguw==", + "version": "8.8.18", + "resolved": "https://registry.npmjs.org/@ionic/core/-/core-8.8.18.tgz", + "integrity": "sha512-QRFqi6gMSTk89FMjtoDx3p6e2dD7mYxqYzS0+Hl+yjxnoWoNFluWKM9rnGEEkdvpY7bF1pt6CI5IwMt+vjYQWg==", "license": "MIT", "dependencies": { "@stencil/core": "4.43.5", @@ -290,12 +290,12 @@ } }, "node_modules/@ionic/react": { - "version": "8.8.17", - "resolved": "https://registry.npmjs.org/@ionic/react/-/react-8.8.17.tgz", - "integrity": "sha512-k3ufmaxJUQPbifEdoYZFz9vxHy/rlU+K+pXVpo6wgyYMEeF2GHsASjViqLDVh3KVHXZKu6RYk7OpdETFc5Ltlw==", + "version": "8.8.18", + "resolved": "https://registry.npmjs.org/@ionic/react/-/react-8.8.18.tgz", + "integrity": "sha512-Hp7PuvuzqREzyWTDFYykgDLDE4RqE932+YX/gr0O3N/EfrPBAeuDeVZqPh2NLGQvliDcU1mwItGxWy/H0PK+Qg==", "license": "MIT", "dependencies": { - "@ionic/core": "8.8.17", + "@ionic/core": "8.8.18", "ionicons": "^8.0.13", "tslib": "*" }, diff --git a/packages/react-router/package.json b/packages/react-router/package.json index c6c4bfc6ee2..1a8b3fe271b 100644 --- a/packages/react-router/package.json +++ b/packages/react-router/package.json @@ -1,6 +1,6 @@ { "name": "@ionic/react-router", - "version": "8.8.17", + "version": "8.8.18", "description": "React Router wrapper for @ionic/react", "keywords": [ "ionic", @@ -37,7 +37,7 @@ "dist/" ], "dependencies": { - "@ionic/react": "^8.8.17", + "@ionic/react": "^8.8.18", "tslib": "*" }, "peerDependencies": { diff --git a/packages/react/CHANGELOG.md b/packages/react/CHANGELOG.md index 74bf41814ce..7daf28a6f78 100644 --- a/packages/react/CHANGELOG.md +++ b/packages/react/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [8.8.18](https://github.com/ionic-team/ionic-framework/compare/v8.8.17...v8.8.18) (2026-08-12) + +**Note:** Version bump only for package @ionic/react + + + + + ## [8.8.17](https://github.com/ionic-team/ionic-framework/compare/v8.8.16...v8.8.17) (2026-08-05) **Note:** Version bump only for package @ionic/react diff --git a/packages/react/package-lock.json b/packages/react/package-lock.json index 16ad6083c5c..c802c5deb7d 100644 --- a/packages/react/package-lock.json +++ b/packages/react/package-lock.json @@ -1,15 +1,15 @@ { "name": "@ionic/react", - "version": "8.8.17", + "version": "8.8.18", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@ionic/react", - "version": "8.8.17", + "version": "8.8.18", "license": "MIT", "dependencies": { - "@ionic/core": "^8.8.17", + "@ionic/core": "^8.8.18", "@stencil/react-output-target": "^1.5.2", "ionicons": "^8.0.13", "tslib": "*" @@ -891,9 +891,9 @@ } }, "node_modules/@ionic/core": { - "version": "8.8.17", - "resolved": "https://registry.npmjs.org/@ionic/core/-/core-8.8.17.tgz", - "integrity": "sha512-w4Ya+0EpGqajVbp6c6TMt4u/MX1flmdzpz2gfgXUkRgp/YfFIRw8n6pIZEOv4EzdUzrhhvPVUEZR64w9R5Fguw==", + "version": "8.8.18", + "resolved": "https://registry.npmjs.org/@ionic/core/-/core-8.8.18.tgz", + "integrity": "sha512-QRFqi6gMSTk89FMjtoDx3p6e2dD7mYxqYzS0+Hl+yjxnoWoNFluWKM9rnGEEkdvpY7bF1pt6CI5IwMt+vjYQWg==", "license": "MIT", "dependencies": { "@stencil/core": "4.43.5", diff --git a/packages/react/package.json b/packages/react/package.json index df0d2e949d0..fffb8069904 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -1,6 +1,6 @@ { "name": "@ionic/react", - "version": "8.8.17", + "version": "8.8.18", "description": "React specific wrapper for @ionic/core", "keywords": [ "ionic", @@ -41,7 +41,7 @@ "css/" ], "dependencies": { - "@ionic/core": "^8.8.17", + "@ionic/core": "^8.8.18", "@stencil/react-output-target": "^1.5.2", "ionicons": "^8.0.13", "tslib": "*" diff --git a/packages/vue-router/CHANGELOG.md b/packages/vue-router/CHANGELOG.md index 6c9e5d49242..fe3d03966f9 100644 --- a/packages/vue-router/CHANGELOG.md +++ b/packages/vue-router/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [8.8.18](https://github.com/ionic-team/ionic-framework/compare/v8.8.17...v8.8.18) (2026-08-12) + +**Note:** Version bump only for package @ionic/vue-router + + + + + ## [8.8.17](https://github.com/ionic-team/ionic-framework/compare/v8.8.16...v8.8.17) (2026-08-05) **Note:** Version bump only for package @ionic/vue-router diff --git a/packages/vue-router/package-lock.json b/packages/vue-router/package-lock.json index 463e8381b9f..401db4d810a 100644 --- a/packages/vue-router/package-lock.json +++ b/packages/vue-router/package-lock.json @@ -1,15 +1,15 @@ { "name": "@ionic/vue-router", - "version": "8.8.17", + "version": "8.8.18", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@ionic/vue-router", - "version": "8.8.17", + "version": "8.8.18", "license": "MIT", "dependencies": { - "@ionic/vue": "^8.8.17" + "@ionic/vue": "^8.8.18" }, "devDependencies": { "@eslint/eslintrc": "^3.3.1", @@ -342,9 +342,9 @@ } }, "node_modules/@ionic/core": { - "version": "8.8.17", - "resolved": "https://registry.npmjs.org/@ionic/core/-/core-8.8.17.tgz", - "integrity": "sha512-w4Ya+0EpGqajVbp6c6TMt4u/MX1flmdzpz2gfgXUkRgp/YfFIRw8n6pIZEOv4EzdUzrhhvPVUEZR64w9R5Fguw==", + "version": "8.8.18", + "resolved": "https://registry.npmjs.org/@ionic/core/-/core-8.8.18.tgz", + "integrity": "sha512-QRFqi6gMSTk89FMjtoDx3p6e2dD7mYxqYzS0+Hl+yjxnoWoNFluWKM9rnGEEkdvpY7bF1pt6CI5IwMt+vjYQWg==", "license": "MIT", "dependencies": { "@stencil/core": "4.43.5", @@ -382,12 +382,12 @@ } }, "node_modules/@ionic/vue": { - "version": "8.8.17", - "resolved": "https://registry.npmjs.org/@ionic/vue/-/vue-8.8.17.tgz", - "integrity": "sha512-aD7rgodl9lw0cziNxEE/dpnms9+lNlvTB6d54vGmuaqZdgqe6zqnWVMigmR6Acf8kUEDdYh+w0/XnP5BKfJsoQ==", + "version": "8.8.18", + "resolved": "https://registry.npmjs.org/@ionic/vue/-/vue-8.8.18.tgz", + "integrity": "sha512-4Cqp9L+nubSK5PnG8eKENfdnjFL/ze0Et7W87rQYTQzAVxiNqK9vmdVzWK8BErP1uSV+lbXsiQ8SrzQl6mlNiQ==", "license": "MIT", "dependencies": { - "@ionic/core": "8.8.17", + "@ionic/core": "8.8.18", "@stencil/vue-output-target": "0.10.7", "ionicons": "^8.0.13" } diff --git a/packages/vue-router/package.json b/packages/vue-router/package.json index 7c73c1e8ddd..136265a176b 100644 --- a/packages/vue-router/package.json +++ b/packages/vue-router/package.json @@ -1,6 +1,6 @@ { "name": "@ionic/vue-router", - "version": "8.8.17", + "version": "8.8.18", "description": "Vue Router integration for @ionic/vue", "scripts": { "eslint": "eslint src", @@ -44,7 +44,7 @@ }, "homepage": "https://github.com/ionic-team/ionic-framework#readme", "dependencies": { - "@ionic/vue": "^8.8.17" + "@ionic/vue": "^8.8.18" }, "devDependencies": { "@eslint/eslintrc": "^3.3.1", diff --git a/packages/vue/CHANGELOG.md b/packages/vue/CHANGELOG.md index c7c1207ed58..3a17d3483f4 100644 --- a/packages/vue/CHANGELOG.md +++ b/packages/vue/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [8.8.18](https://github.com/ionic-team/ionic-framework/compare/v8.8.17...v8.8.18) (2026-08-12) + +**Note:** Version bump only for package @ionic/vue + + + + + ## [8.8.17](https://github.com/ionic-team/ionic-framework/compare/v8.8.16...v8.8.17) (2026-08-05) diff --git a/packages/vue/package-lock.json b/packages/vue/package-lock.json index c0e2ec3977d..3c17eea6088 100644 --- a/packages/vue/package-lock.json +++ b/packages/vue/package-lock.json @@ -1,15 +1,15 @@ { "name": "@ionic/vue", - "version": "8.8.17", + "version": "8.8.18", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@ionic/vue", - "version": "8.8.17", + "version": "8.8.18", "license": "MIT", "dependencies": { - "@ionic/core": "^8.8.17", + "@ionic/core": "^8.8.18", "@stencil/vue-output-target": "0.13.1", "ionicons": "^8.0.13" }, @@ -346,9 +346,9 @@ } }, "node_modules/@ionic/core": { - "version": "8.8.17", - "resolved": "https://registry.npmjs.org/@ionic/core/-/core-8.8.17.tgz", - "integrity": "sha512-w4Ya+0EpGqajVbp6c6TMt4u/MX1flmdzpz2gfgXUkRgp/YfFIRw8n6pIZEOv4EzdUzrhhvPVUEZR64w9R5Fguw==", + "version": "8.8.18", + "resolved": "https://registry.npmjs.org/@ionic/core/-/core-8.8.18.tgz", + "integrity": "sha512-QRFqi6gMSTk89FMjtoDx3p6e2dD7mYxqYzS0+Hl+yjxnoWoNFluWKM9rnGEEkdvpY7bF1pt6CI5IwMt+vjYQWg==", "license": "MIT", "dependencies": { "@stencil/core": "4.43.5", diff --git a/packages/vue/package.json b/packages/vue/package.json index ef52bab2e5d..bb100fddc57 100644 --- a/packages/vue/package.json +++ b/packages/vue/package.json @@ -1,6 +1,6 @@ { "name": "@ionic/vue", - "version": "8.8.17", + "version": "8.8.18", "description": "Vue specific wrapper for @ionic/core", "scripts": { "eslint": "eslint src", @@ -78,7 +78,7 @@ } }, "dependencies": { - "@ionic/core": "^8.8.17", + "@ionic/core": "^8.8.18", "@stencil/vue-output-target": "0.13.1", "ionicons": "^8.0.13" }, diff --git a/renovate.json5 b/renovate.json5 index a25638f407e..d50c442adff 100644 --- a/renovate.json5 +++ b/renovate.json5 @@ -41,18 +41,41 @@ matchPackageNames: ["@playwright/test", "@axe-core/playwright", "playwright-core"], groupName: "playwright", matchFileNames: [ - "core/package.json" + "core/package.json", + "core/Dockerfile" ], - "rangeStrategy": "bump" + "rangeStrategy": "bump", + /** + * The mcr.microsoft.com/playwright Docker image is usually published + * about a day after the npm release. Waiting a few days before opening + * the PR gives the image time to appear, so the Dockerfile bump has a + * valid tag to point at. Both files are driven by the npm datasource + * (refer to customManagers below), so they always bump together. + * + * If the Docker build still fails because the tag does not exist yet, + * the image has not been published for this release. To fix it, confirm + * the image is available, then re-run the failed CI job. No code change + * is needed because the tag is already correct; the registry just needs + * time to catch up. + */ + minimumReleaseAge: "3 days" }, { + /** + * The built-in Docker manager tracks the mcr.microsoft.com/playwright tag + * against the container registry, which lags the npm release by about a day. + * That lag decouples the Dockerfile from the npm bump: the update either + * arrives as its own PR or has to be folded into the grouped PR with a + * manual rebase. Disable it and drive the tag from the npm datasource + * instead (refer to customManagers below) so the Dockerfile and + * core/package.json bump together. + */ matchDatasources: ["docker"], matchPackageNames: ["mcr.microsoft.com/playwright"], - groupName: "playwright", matchFileNames: [ "core/Dockerfile" ], - versioning: "semver" + enabled: false }, { matchPackagePatterns: ["ionicons"], @@ -107,6 +130,22 @@ groupName: "node-version-updates" } ], + customManagers: [ + { + /** + * Bump the Playwright Docker image tag in core/Dockerfile from the npm + * @playwright/test release instead of the container registry. The image + * tag mirrors the npm version (for example v1.62.0), so this keeps the + * Dockerfile and core/package.json in lockstep within a single PR. + */ + customType: "regex", + managerFilePatterns: ["core/Dockerfile"], + matchStrings: ["mcr\\.microsoft\\.com/playwright:v(?\\S+)"], + depNameTemplate: "@playwright/test", + datasourceTemplate: "npm", + versioningTemplate: "npm" + } + ], dependencyDashboard: false, rebaseWhen: "never", schedule: ["every weekday before 11am"],