mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-09 08:09:32 +08:00
fix(modal): avoid chrome memory leak bug (#26911)
This commit is contained in:
@ -75,6 +75,7 @@ test.describe('modal: rendering', () => {
|
||||
await ionModalDidPresent.next();
|
||||
|
||||
const modal = await page.locator('ion-modal');
|
||||
await expect(modal).toHaveClass(/show-modal/);
|
||||
|
||||
await page.setIonViewport();
|
||||
|
||||
@ -87,6 +88,7 @@ test.describe('modal: rendering', () => {
|
||||
await ionModalWillDismiss.next();
|
||||
await ionModalDidDismiss.next();
|
||||
|
||||
await expect(modal).not.toHaveClass(/show-modal/);
|
||||
await expect(modal).toBeHidden();
|
||||
};
|
||||
|
||||
|
||||
@ -91,8 +91,12 @@ html.ios ion-modal ion-toolbar {
|
||||
* Note 2: This should only apply to non-card and
|
||||
* non-sheet modals. Card and sheet modals have their
|
||||
* own criteria for displaying backdrops/box shadows.
|
||||
*
|
||||
* Do not use :not(.overlay-hidden) in place of
|
||||
* .show-modal because that triggers a memory
|
||||
* leak in Blink: https://bugs.chromium.org/p/chromium/issues/detail?id=1418768
|
||||
*/
|
||||
ion-modal.modal-default:not(.overlay-hidden) ~ ion-modal.modal-default {
|
||||
ion-modal.modal-default.show-modal ~ ion-modal.modal-default {
|
||||
--backdrop-opacity: 0;
|
||||
--box-shadow: none;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user