Skip to content
Merged
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
6 changes: 5 additions & 1 deletion core/src/components/button/button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,11 @@ export class Button implements ComponentInterface, AnchorInterface, ButtonInterf
target,
};
let fill = this.fill;
if (fill === undefined) {
/**
* We check both undefined and null to
* work around https://github.com/ionic-team/stencil/issues/3586.
*/
if (fill == null) {
fill = this.inToolbar || this.inListHeader ? 'clear' : 'solid';
}
return (
Expand Down
19 changes: 19 additions & 0 deletions core/src/components/button/test/basic/button.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,25 @@ test.describe('button: basic', () => {

expect(await page.screenshot()).toMatchSnapshot(`button-diff-${page.getSnapshotSettings()}.png`);
});
test('should correctly set fill to undefined', async ({ page, skip }) => {
test.info().annotations.push({
type: 'issue',
description: 'https://github.com/ionic-team/ionic-framework/issues/25886',
});
skip.rtl();
skip.mode('ios', 'This behavior does not differ across modes');
await page.setContent(`
<ion-button fill="outline"></ion-button>
`);

const button = page.locator('ion-button');
await expect(button).toHaveClass(/button-outline/);

await button.evaluate((el: HTMLIonButtonElement) => (el.fill = undefined));
await page.waitForChanges();

await expect(button).toHaveClass(/button-solid/);
});
});

test.describe('button: ripple effect', () => {
Expand Down