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
11 changes: 11 additions & 0 deletions BREAKING.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ This is a comprehensive list of the breaking changes introduced in the major ver
- [Content](#version-9x-content)
- [Datetime](#version-9x-datetime)
- [Grid](#version-9x-grid)
- [Image](#version-9x-image)
- [Input Otp](#version-9x-input-otp)
- [Item Divider](#version-9x-item-divider)
- [Radio Group](#version-9x-radio-group)
Expand Down Expand Up @@ -251,6 +252,16 @@ To reorder two columns where column 1 has `size="9" push="3"` and column 2 has `
</ion-grid>
```

<h4 id="version-9x-image">Image</h4>

The following breaking changes apply to `ion-img`:

1. Theme classes (`ion-img.md`, `ion-img.ios`) are no longer supported.

<h5>Theme classes</h5>

Remove any instances that target the theme classes: `ion-img.md`, `ion-img.ios`.

<h4 id="version-9x-input-otp">Input Otp</h4>

Converted `ion-input-otp` to use [Shadow DOM](https://developer.mozilla.org/en-US/docs/Web/Web_Components/Using_shadow_DOM).
Expand Down
1 change: 0 additions & 1 deletion core/api.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1068,7 +1068,6 @@ ion-img,shadow
ion-img,prop,alt,string | undefined,undefined,false,false
ion-img,prop,mode,"ios" | "md",undefined,false,false
ion-img,prop,src,string | undefined,undefined,false,false
ion-img,prop,theme,"ios" | "md" | "ionic",undefined,false,false
ion-img,event,ionError,void,true
ion-img,event,ionImgDidLoad,void,true
ion-img,event,ionImgWillLoad,void,true
Expand Down
62 changes: 18 additions & 44 deletions core/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 0 additions & 8 deletions core/src/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1552,10 +1552,6 @@ export namespace Components {
* The image URL. This attribute is mandatory for the `<img>` element.
*/
"src"?: string;
/**
* The theme determines the visual appearance of the component.
*/
"theme"?: "ios" | "md" | "ionic";
}
interface IonInfiniteScroll {
/**
Expand Down Expand Up @@ -7584,10 +7580,6 @@ declare namespace LocalJSX {
* The image URL. This attribute is mandatory for the `<img>` element.
*/
"src"?: string;
/**
* The theme determines the visual appearance of the component.
*/
"theme"?: "ios" | "md" | "ionic";
}
interface IonInfiniteScroll {
/**
Expand Down
10 changes: 1 addition & 9 deletions core/src/components/img/img.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,8 @@ import { Component, Element, Event, Host, Prop, State, Watch, h } from '@stencil
import type { Attributes } from '@utils/helpers';
import { inheritAttributes } from '@utils/helpers';

import { getIonTheme } from '../../global/ionic-global';

/**
* @virtualProp {"ios" | "md"} mode - The mode determines the platform behaviors of the component.
* @virtualProp {"ios" | "md" | "ionic"} theme - The theme determines the visual appearance of the component.
*
* @part image - The inner `img` element.
*/
Expand Down Expand Up @@ -124,13 +121,8 @@ export class Img implements ComponentInterface {
render() {
const { loadSrc, alt, onLoad, loadError, inheritedAttributes } = this;
const { draggable } = inheritedAttributes;
const theme = getIonTheme(this);
return (
<Host
class={{
[theme]: true,
}}
>
<Host>
<img
decoding="async"
src={loadSrc}
Expand Down
7 changes: 3 additions & 4 deletions core/src/components/img/test/basic/img.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ import { configs, test } from '@utils/test/playwright';

configs({ modes: ['md'], directions: ['ltr'] }).forEach(({ title, config }) => {
test.describe(title('img: basic'), () => {
// TODO FW-3596
test.describe.skip('image successfully loads', () => {
test.describe('image successfully loads', () => {
Copy link
Copy Markdown
Contributor Author

@thetaPC thetaPC May 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test was originally marked skip under FW-3596 because it was flaky on CI. That predates the move to Docker based e2e runs, where the test environment is now deterministic (pinned browser, pinned OS, controlled timing). The flake was almost certainly caused by host environment variance.

Verified stable by running npm run test.e2e.docker img/test/basic -- --repeat-each=80 locally several times. Zero failures.

If the test ends up flaking in the future, we can skip and create a new ticket to address it.

let ionImgWillLoad: EventSpy;
let ionImgDidLoad: EventSpy;

Expand All @@ -16,7 +15,7 @@ configs({ modes: ['md'], directions: ['ltr'] }).forEach(({ title, config }) => {
status: 200,
contentType: 'image/png',
body: Buffer.from(
'iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z8BQDwAEhQGAhKmMIwAAAABJRU5ErkJggg==',
'iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII=',
'base64'
),
});
Expand Down Expand Up @@ -52,7 +51,7 @@ configs({ modes: ['md'], directions: ['ltr'] }).forEach(({ title, config }) => {
test('should emit ionImgDidLoad', async () => {
await ionImgDidLoad.next();

expect(ionImgWillLoad).toHaveReceivedEventTimes(1);
expect(ionImgDidLoad).toHaveReceivedEventTimes(1);
});
});

Expand Down
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The old version was accidentally added during a sync. The original version was generated through a flaky test so it's not the true snapshot.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading