Skip to content

Commit d709ff6

Browse files
authored
fix(react): inline overlays display contents consistently (#26255)
Resolves #26253
1 parent 16e882f commit d709ff6

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

packages/react/src/components/createInlineOverlayComponent.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ export const createInlineOverlayComponent = <PropType, ElementType>(
144144
{
145145
id: 'ion-react-wrapper',
146146
ref: this.wrapperRef,
147+
className: 'ion-delegate-host',
147148
style: {
148149
display: 'flex',
149150
flexDirection: 'column',

packages/react/test-app/tests/e2e/specs/overlay-components/KeepContentsMounted.cy.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,25 @@ describe('keepContentsMounted', () => {
2727

2828
cy.get('ion-modal ion-content').should('exist');
2929
});
30+
31+
it('should display contents consistently on re-open', () => {
32+
// https://github.com/ionic-team/ionic-framework/issues/26253
33+
cy.visit('/keep-contents-mounted');
34+
35+
cy.get('#open-modal').click();
36+
37+
cy.get('ion-modal ion-content').should('exist');
38+
39+
cy.get('ion-modal ion-button').click();
40+
41+
cy.get('ion-modal')
42+
.should('not.be.visible')
43+
.should('have.class', 'overlay-hidden');
44+
45+
cy.get('#open-modal').click();
46+
47+
cy.get('ion-modal ion-button').should('be.visible');
48+
})
3049
})
3150
describe('popover', () => {
3251
it('should not mount component if false', () => {

0 commit comments

Comments
 (0)