mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
fix(ios-dialogs): unable to show dialog from modal view without a page (#5881)
* fix(ios-dialogs): unable to show dialog from modal view * tests(modal-navigation): add test that opens dialog inside modal view
This commit is contained in:
committed by
SvetoslavTsenov
parent
afb6543396
commit
86f9d38706
1
tns-core-modules/ui/core/view/view.d.ts
vendored
1
tns-core-modules/ui/core/view/view.d.ts
vendored
@@ -775,6 +775,7 @@ export const isEnabledProperty: Property<View, boolean>;
|
||||
export const isUserInteractionEnabledProperty: Property<View, boolean>;
|
||||
|
||||
export namespace ios {
|
||||
export function getParentWithViewController(parent: View): View
|
||||
export function isContentScrollable(controller: any /* UIViewController */, owner: View): boolean
|
||||
export function updateAutoAdjustScrollInsets(controller: any /* UIViewController */, owner: View): void
|
||||
export function updateConstraints(controller: any /* UIViewController */, owner: View): void;
|
||||
|
||||
@@ -308,18 +308,8 @@ export class View extends ViewCommon {
|
||||
return this._suspendCATransaction || this._suspendNativeUpdatesCount;
|
||||
}
|
||||
|
||||
private getParentWithViewController(parent: View): View {
|
||||
let view = parent;
|
||||
let controller = view.viewController;
|
||||
while (!controller) {
|
||||
view = view.parent as View;
|
||||
controller = view.viewController;
|
||||
}
|
||||
|
||||
return view;
|
||||
}
|
||||
protected _showNativeModalView(parent: View, context: any, closeCallback: Function, fullscreen?: boolean, animated?: boolean, stretched?: boolean) {
|
||||
let parentWithController = this.getParentWithViewController(parent);
|
||||
let parentWithController = ios.getParentWithViewController(parent);
|
||||
|
||||
super._showNativeModalView(parentWithController, context, closeCallback, fullscreen, stretched);
|
||||
let controller = this.viewController;
|
||||
@@ -592,6 +582,17 @@ export class CustomLayoutView extends View {
|
||||
}
|
||||
|
||||
export namespace ios {
|
||||
export function getParentWithViewController(parent: View): View {
|
||||
let view = parent;
|
||||
let controller = view.viewController;
|
||||
while (!controller) {
|
||||
view = view.parent as View;
|
||||
controller = view.viewController;
|
||||
}
|
||||
|
||||
return view;
|
||||
}
|
||||
|
||||
export function isContentScrollable(controller: UIViewController, owner: View): boolean {
|
||||
let scrollableContent = (<any>owner).scrollableContent;
|
||||
if (scrollableContent === undefined) {
|
||||
|
||||
Reference in New Issue
Block a user