mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-09 08:09:32 +08:00
Merge remote-tracking branch 'origin/main' into chore/sync-7.0-with-main-12-05-22
This commit is contained in:
@ -21,6 +21,7 @@ import { raf, inheritAttributes, hasLazyBuild } from '../../utils/helpers';
|
||||
import type { Attributes } from '../../utils/helpers';
|
||||
import { KEYBOARD_DID_OPEN } from '../../utils/keyboard/keyboard';
|
||||
import { printIonWarning } from '../../utils/logging';
|
||||
import { Style as StatusBarStyle, StatusBar } from '../../utils/native/status-bar';
|
||||
import { BACKDROP, activeAnimations, dismiss, eventMethod, prepareOverlay, present } from '../../utils/overlays';
|
||||
import { getClassMap } from '../../utils/theme';
|
||||
import { deepReady } from '../../utils/transition';
|
||||
@ -67,6 +68,7 @@ export class Modal implements ComponentInterface, OverlayInterface {
|
||||
private keyboardOpenCallback?: () => void;
|
||||
private moveSheetToBreakpoint?: (options: MoveSheetToBreakpointOptions) => Promise<void>;
|
||||
private inheritedAttributes: Attributes = {};
|
||||
private statusBarStyle?: StatusBarStyle;
|
||||
|
||||
private inline = false;
|
||||
private workingDelegate?: FrameworkDelegate;
|
||||
@ -481,6 +483,8 @@ export class Modal implements ComponentInterface, OverlayInterface {
|
||||
* by the time the card animation is done.
|
||||
*/
|
||||
if (hasCardModal && getIonMode(this) === 'ios') {
|
||||
// Cache the original status bar color before the modal is presented
|
||||
this.statusBarStyle = await StatusBar.getStyle();
|
||||
setCardStatusBarDark();
|
||||
}
|
||||
|
||||
@ -538,7 +542,9 @@ export class Modal implements ComponentInterface, OverlayInterface {
|
||||
return;
|
||||
}
|
||||
|
||||
this.gesture = createSwipeToCloseGesture(el, ani, () => {
|
||||
const statusBarStyle = this.statusBarStyle ?? StatusBarStyle.Default;
|
||||
|
||||
this.gesture = createSwipeToCloseGesture(el, ani, statusBarStyle, () => {
|
||||
/**
|
||||
* While the gesture animation is finishing
|
||||
* it is possible for a user to tap the backdrop.
|
||||
@ -648,7 +654,7 @@ export class Modal implements ComponentInterface, OverlayInterface {
|
||||
*/
|
||||
const hasCardModal = presentingElement !== undefined;
|
||||
if (hasCardModal && getIonMode(this) === 'ios') {
|
||||
setCardStatusBarDefault();
|
||||
setCardStatusBarDefault(this.statusBarStyle);
|
||||
}
|
||||
|
||||
/* tslint:disable-next-line */
|
||||
|
||||
Reference in New Issue
Block a user