tidev / titanium-sdk

🚀 Native iOS and Android Apps with JavaScript
https://titaniumsdk.com/
Other
2.76k stars 1.21k forks source link

iOS: Broken nested NavigationWindow's windows opening. #14100

Open yuranevmer opened 2 months ago

yuranevmer commented 2 months ago

I have searched and made sure there are no existing issues for the issue I am filing

Description

navigationWindow.openWindow(window) - doesn't show new window if navigationWindow was opened in another NavigationWindow's.

Expected Behavior

Window opened in nested navigation stack was opened (displayed on the screen).

Actual behavior

Window opened in nested navigation stack was not displayed on the screen.

Reproducible sample

const nestedNavWin = Ti.UI.createNavigationWindow({
    window: Ti.UI.createWindow({ backgroundColor: "yellow" })
});

const mainNavWin = Ti.UI.createNavigationWindow({
    window: Ti.UI.createWindow()
    // but if pass `nestedNavWin` as window in creation time it works
    // window: nestedNavWin
});

mainNavWin.open();

// open nested navigation
_.delay(() => {
    mainNavWin.openWindow(nestedNavWin);
}, 1000);

// window opened by nested navigation doesn't show
_.delay(() => {
    console.log("Must open red window");
    nestedNavWin.openWindow(Ti.UI.createWindow({ backgroundColor: "red" }));
}, 3000);

Steps to reproduce

One NavigationWindow opens another NavigationWindow (using openWindow() method). Nested NavigationWindow tries to open one more window in stack.

Platform

iOS

SDK version you are using

12

Alloy version you are using

No response

yuranevmer commented 2 months ago

Reverting this commit fixes the issue.

m1ga commented 2 months ago

@hansemannn you might want to check that. Maybe a check if it is a modal window or not and then use the old code or the new one?

hansemannn commented 2 months ago

Interesting. I will check that in my team after vacation and come back here 🙌

hansemannn commented 2 months ago

Hi there! I have reverted the change for now, as it still works on iOS 16+ (maybe it was just a beta issue back then) and also backported it to 12_5_X, so it will be included in the next release already! If you see issues again, please let me know and I can take a closer look into migrating the selectors.