Skip to content

Commit

Permalink
fix(angular): overlay not found
Browse files Browse the repository at this point in the history
fixes #15349
  • Loading branch information
manucorporat committed Aug 28, 2018
1 parent 57d2f57 commit 8dfc52f
Show file tree
Hide file tree
Showing 10 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion angular/src/util/overlay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export class OverlayBaseController<Opts, Overlay> {
return proxyMethod(this.ctrl, 'create', opts);
}

dismiss(data?: any, role?: string, id = -1): Promise<void> {
dismiss(data?: any, role?: string, id?: number): Promise<void> {
return proxyMethod(this.ctrl, 'dismiss', data, role, id);
}

Expand Down
16 changes: 8 additions & 8 deletions core/src/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import '@stencil/core';

import 'ionicons'
import 'ionicons';
import {
ActionSheetButton,
ActionSheetOptions,
Expand Down Expand Up @@ -79,7 +79,7 @@ export namespace Components {
/**
* Get the most recently opened action sheet overlay.
*/
'getTop': () => Promise<HTMLIonActionSheetElement>;
'getTop': () => Promise<HTMLIonActionSheetElement | undefined>;
}
interface IonActionSheetControllerAttributes extends StencilHTMLAttributes {}

Expand Down Expand Up @@ -228,7 +228,7 @@ export namespace Components {
/**
* Get the most recently opened alert overlay.
*/
'getTop': () => Promise<HTMLIonAlertElement>;
'getTop': () => Promise<HTMLIonAlertElement | undefined>;
}
interface IonAlertControllerAttributes extends StencilHTMLAttributes {}

Expand Down Expand Up @@ -2219,7 +2219,7 @@ export namespace Components {
/**
* Get the most recently opened loading overlay.
*/
'getTop': () => Promise<HTMLIonLoadingElement>;
'getTop': () => Promise<HTMLIonLoadingElement | undefined>;
}
interface IonLoadingControllerAttributes extends StencilHTMLAttributes {}

Expand Down Expand Up @@ -2561,7 +2561,7 @@ export namespace Components {
/**
* Get the most recently opened modal overlay.
*/
'getTop': () => Promise<HTMLIonModalElement>;
'getTop': () => Promise<HTMLIonModalElement | undefined>;
}
interface IonModalControllerAttributes extends StencilHTMLAttributes {}

Expand Down Expand Up @@ -2861,7 +2861,7 @@ export namespace Components {
interface IonPickerController {
'create': (opts: PickerOptions) => Promise<HTMLIonPickerElement>;
'dismiss': (data?: any, role?: string | undefined, pickerId?: number | undefined) => Promise<void>;
'getTop': () => Promise<HTMLIonPickerElement>;
'getTop': () => Promise<HTMLIonPickerElement | undefined>;
}
interface IonPickerControllerAttributes extends StencilHTMLAttributes {}

Expand Down Expand Up @@ -3008,7 +3008,7 @@ export namespace Components {
/**
* Get the most recently opened popover overlay.
*/
'getTop': () => Promise<HTMLIonPopoverElement>;
'getTop': () => Promise<HTMLIonPopoverElement | undefined>;
}
interface IonPopoverControllerAttributes extends StencilHTMLAttributes {}

Expand Down Expand Up @@ -4828,7 +4828,7 @@ export namespace Components {
/**
* Get the most recently opened toast overlay.
*/
'getTop': () => Promise<HTMLIonToastElement>;
'getTop': () => Promise<HTMLIonToastElement | undefined>;
}
interface IonToastControllerAttributes extends StencilHTMLAttributes {}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export class ActionSheetController implements OverlayController {
* Get the most recently opened action sheet overlay.
*/
@Method()
async getTop(): Promise<HTMLIonActionSheetElement> {
async getTop(): Promise<HTMLIonActionSheetElement | undefined> {
return getOverlay(this.doc, 'ion-action-sheet') as HTMLIonActionSheetElement;
}
}
2 changes: 1 addition & 1 deletion core/src/components/alert-controller/alert-controller.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export class AlertController implements OverlayController {
* Get the most recently opened alert overlay.
*/
@Method()
async getTop(): Promise<HTMLIonAlertElement> {
async getTop(): Promise<HTMLIonAlertElement | undefined> {
return getOverlay(this.doc, 'ion-alert') as HTMLIonAlertElement;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export class LoadingController implements OverlayController {
* Get the most recently opened loading overlay.
*/
@Method()
async getTop(): Promise<HTMLIonLoadingElement> {
async getTop(): Promise<HTMLIonLoadingElement | undefined> {
return getOverlay(this.doc, 'ion-loading') as HTMLIonLoadingElement;
}
}
2 changes: 1 addition & 1 deletion core/src/components/modal-controller/modal-controller.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export class ModalController implements OverlayController {
* Get the most recently opened modal overlay.
*/
@Method()
async getTop(): Promise<HTMLIonModalElement> {
async getTop(): Promise<HTMLIonModalElement | undefined> {
return getOverlay(this.doc, 'ion-modal') as HTMLIonModalElement;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export class PickerController implements OverlayController {
* Get the most recently opened picker overlay.
*/
@Method()
async getTop(): Promise<HTMLIonPickerElement> {
async getTop(): Promise<HTMLIonPickerElement | undefined> {
return getOverlay(this.doc, 'ion-picker') as HTMLIonPickerElement;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export class PopoverController implements OverlayController {
* Get the most recently opened popover overlay.
*/
@Method()
async getTop(): Promise<HTMLIonPopoverElement> {
async getTop(): Promise<HTMLIonPopoverElement | undefined> {
return getOverlay(this.doc, 'ion-popover') as HTMLIonPopoverElement;
}
}
2 changes: 1 addition & 1 deletion core/src/components/toast-controller/toast-controller.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export class ToastController implements OverlayController {
* Get the most recently opened toast overlay.
*/
@Method()
async getTop(): Promise<HTMLIonToastElement> {
async getTop(): Promise<HTMLIonToastElement | undefined> {
return getOverlay(this.doc, 'ion-toast') as HTMLIonToastElement;
}
}
2 changes: 1 addition & 1 deletion core/src/utils/overlays-interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export interface OverlayInterface {
export interface OverlayController {
create(opts?: any): Promise<HTMLElement>;
dismiss(data?: any, role?: string, alertId?: number): Promise<void>;
getTop(): Promise<HTMLElement>;
getTop(): Promise<HTMLIonOverlayElement | undefined>;
}

export interface HTMLIonOverlayElement extends HTMLStencilElement {
Expand Down

0 comments on commit 8dfc52f

Please sign in to comment.