mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-10 00:27:41 +08:00
fix(prerender): local references to window/document
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
import { Component, Listen, Method } from '@stencil/core';
|
||||
import { Component, Listen, Method, Prop } from '@stencil/core';
|
||||
import { ActionSheetOptions } from '../../index';
|
||||
import { OverlayController, createOverlay, dismissOverlay, getTopOverlay, removeLastOverlay } from '../../utils/overlays';
|
||||
|
||||
@ -9,6 +9,8 @@ export class ActionSheetController implements OverlayController {
|
||||
|
||||
private actionSheets = new Map<number, HTMLIonActionSheetElement>();
|
||||
|
||||
@Prop({ context: 'document' }) doc: Document;
|
||||
|
||||
@Listen('body:ionActionSheetWillPresent')
|
||||
protected actionSheetWillPresent(ev: any) {
|
||||
this.actionSheets.set(ev.target.overlayId, ev.target);
|
||||
@ -30,7 +32,7 @@ export class ActionSheetController implements OverlayController {
|
||||
*/
|
||||
@Method()
|
||||
create(opts?: ActionSheetOptions): Promise<HTMLIonActionSheetElement> {
|
||||
return createOverlay(document.createElement('ion-action-sheet'), opts);
|
||||
return createOverlay(this.doc.createElement('ion-action-sheet'), opts);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user