Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ios): hierarchy error when using SplitWindow and NavigationWindow #12930

Merged
merged 5 commits into from Jul 20, 2021

Conversation

jquick-axway
Copy link
Contributor

JIRA:
https://jira.appcelerator.org/browse/TIMOB-28497

Summary:

  • Fixes regression introduced into Titanium 10.0.0 when you use both a SplitWindow and a NavigationWindow at the same time.
  • Caused by nested NavigationWindow wrongly using root application controller instead of the 1sts controller available in the view hierarchy.

Test:

  1. Build and run the below on iPad.
  2. Verify the app does not crash on app startup. (This is the fix.)
  3. Verify you see a ListView on the left side with a title "Master View" above it.
  4. Verify you see a "Hello World" label in the middle of the screen with title "Detail View" above it.
const masterWindow = Ti.UI.createWindow({ title: "Master View" });
masterWindow.add(Ti.UI.createListView({
	sections: [
		Ti.UI.createListSection({
			items: [
				{ properties: { title: "Row 1" } },
				{ properties: { title: "Row 2" } },
				{ properties: { title: "Row 3" } },
			],
		}),
	],
}));

const detailWindow = Ti.UI.createWindow({ title: "Detail View" });
detailWindow.add(Ti.UI.createLabel({ text: "Hello World!" }));

const splitWindow = Ti.UI.iOS.createSplitWindow({
	detailView: Ti.UI.createNavigationWindow({ window: detailWindow }),
	masterView: Ti.UI.createNavigationWindow({ window: masterWindow }),
	backgroundColor: "white",
	showMasterInPortrait: true,
});
Ti.UI.createNavigationWindow({ window: splitWindow }).open();

@jquick-axway jquick-axway added this to the 10.1.0 milestone Jun 28, 2021
@build build requested a review from a team June 28, 2021 21:15
@build
Copy link
Contributor

build commented Jun 28, 2021

Fails
🚫 Tests have failed, see below for more information.
Messages
📖 ❌ 2 tests have failed There are 2 tests failing and 1158 skipped out of 18739 total tests.
📖 ✊ The commits in this PR match our conventions! Feel free to Rebase and Merge this PR when ready.

Tests:

ClassnameNameTimeError
ios.iphone.Titanium.Media.VideoPlayerClose window containing a video player (TIMOB-25574) (14.4.0)127.277
Error: Timeout of 15000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (app.js)
ios.iphone.Titanium.UI.iOS.CollisionBehavior.exampleworks (14.4.0)15
Error: Timeout of 15000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (app.js)

Generated by 🚫 dangerJS against 661e45a

Copy link
Contributor

@garymathews garymathews left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CR: PASS

@garymathews garymathews added in-qe-testing 🕵 backport 10_2_X when applied, PRs with this label will get an auto-generated backport to 10_2_X branch on merge labels Jun 29, 2021
@jquick-axway jquick-axway removed the backport 10_2_X when applied, PRs with this label will get an auto-generated backport to 10_2_X branch on merge label Jun 29, 2021
@lokeshchdhry
Copy link
Contributor

FR Passed.

@jquick-axway jquick-axway added the backport 10_2_X when applied, PRs with this label will get an auto-generated backport to 10_2_X branch on merge label Jul 19, 2021
@ewanharris ewanharris merged commit ed0fbbb into tidev:master Jul 20, 2021
@build build removed the backport 10_2_X when applied, PRs with this label will get an auto-generated backport to 10_2_X branch on merge label Jul 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants