mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-15 01:03:03 +08:00
fix(vue): loading is created as an inline component (#26191)
This commit is contained in:
@ -15,7 +15,6 @@ function generateOverlays() {
|
||||
},
|
||||
{
|
||||
tag: 'ion-loading',
|
||||
controller: 'loadingController',
|
||||
name: 'IonLoading'
|
||||
},
|
||||
{
|
||||
@ -61,7 +60,10 @@ export const ${component.name} = /*@__PURE__*/ defineOverlayContainer<JSX.${comp
|
||||
`);
|
||||
});
|
||||
|
||||
const template = `/* auto-generated vue overlay proxies */
|
||||
const template = `/**
|
||||
* This is an autogenerated file created by 'scripts/copy-overlays.js'.
|
||||
* Changes made to this file will be overwritten on build.
|
||||
*/
|
||||
|
||||
import {
|
||||
JSX,
|
||||
|
@ -1,10 +1,12 @@
|
||||
/* auto-generated vue overlay proxies */
|
||||
/**
|
||||
* This is an autogenerated file created by 'scripts/copy-overlays.js'.
|
||||
* Changes made to this file will be overwritten on build.
|
||||
*/
|
||||
|
||||
import {
|
||||
JSX,
|
||||
actionSheetController,
|
||||
alertController,
|
||||
loadingController,
|
||||
pickerController,
|
||||
toastController,
|
||||
} from '@ionic/core/components';
|
||||
@ -23,7 +25,7 @@ export const IonActionSheet = /*@__PURE__*/ defineOverlayContainer<JSX.IonAction
|
||||
|
||||
export const IonAlert = /*@__PURE__*/ defineOverlayContainer<JSX.IonAlert>('ion-alert', defineIonAlertCustomElement, ['animated', 'backdropDismiss', 'buttons', 'cssClass', 'enterAnimation', 'header', 'htmlAttributes', 'inputs', 'keyboardClose', 'leaveAnimation', 'message', 'mode', 'subHeader', 'translucent'], alertController);
|
||||
|
||||
export const IonLoading = /*@__PURE__*/ defineOverlayContainer<JSX.IonLoading>('ion-loading', defineIonLoadingCustomElement, ['animated', 'backdropDismiss', 'cssClass', 'duration', 'enterAnimation', 'htmlAttributes', 'isOpen', 'keyboardClose', 'leaveAnimation', 'message', 'mode', 'showBackdrop', 'spinner', 'translucent', 'trigger'], loadingController);
|
||||
export const IonLoading = /*@__PURE__*/ defineOverlayContainer<JSX.IonLoading>('ion-loading', defineIonLoadingCustomElement, ['animated', 'backdropDismiss', 'cssClass', 'duration', 'enterAnimation', 'htmlAttributes', 'isOpen', 'keyboardClose', 'leaveAnimation', 'message', 'mode', 'showBackdrop', 'spinner', 'translucent', 'trigger']);
|
||||
|
||||
export const IonPicker = /*@__PURE__*/ defineOverlayContainer<JSX.IonPicker>('ion-picker', defineIonPickerCustomElement, ['animated', 'backdropDismiss', 'buttons', 'columns', 'cssClass', 'duration', 'enterAnimation', 'htmlAttributes', 'keyboardClose', 'leaveAnimation', 'mode', 'showBackdrop'], pickerController);
|
||||
|
||||
|
@ -32,11 +32,29 @@ const testComponent = (overlay, shadow = false) => {
|
||||
* so they should not be removed from the DOM. This test
|
||||
* might need to be revisited if other overlay components
|
||||
* are converted to shadow as well.
|
||||
*
|
||||
* Migrate these overlays to use `testInlineOverlay` instead.
|
||||
*/
|
||||
cy.get(overlay).should('not.exist');
|
||||
}
|
||||
}
|
||||
|
||||
const testInlineOverlay = (overlay, shadow = false) => {
|
||||
cy.get(`ion-radio#${overlay}`).click();
|
||||
cy.get('ion-radio#component').click();
|
||||
|
||||
cy.get('ion-button#present-overlay').click();
|
||||
cy.get(overlay).should('exist').should('be.visible');
|
||||
|
||||
if (shadow) {
|
||||
cy.get(overlay).shadow().find('ion-backdrop').click({ force: true });
|
||||
} else {
|
||||
cy.get(`${overlay} ion-backdrop`).click({ force: true });
|
||||
|
||||
cy.get(overlay).should('not.be.visible');
|
||||
}
|
||||
}
|
||||
|
||||
describe('Overlays', () => {
|
||||
beforeEach(() => {
|
||||
cy.viewport(1000, 900);
|
||||
@ -84,7 +102,7 @@ describe('Overlays', () => {
|
||||
});
|
||||
|
||||
it(`should open and close ion-loading via component`, () => {
|
||||
testComponent('ion-loading');
|
||||
testInlineOverlay('ion-loading');
|
||||
});
|
||||
|
||||
it(`should open and close ion-modal via component`, () => {
|
||||
|
Reference in New Issue
Block a user