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

Fixes default value for back button when title is empty #6552

Merged
merged 2 commits into from
Sep 9, 2020

Conversation

mateioprea
Copy link
Collaborator

When the current navigation stack presents a new view controller with the topbar included, if the previous view controller didn't had a {title: {text: string}} defined, the app crashed.

This commit fixes this issue which, by default, should render the back button with no text.

@yogevbd
Copy link
Collaborator

yogevbd commented Sep 9, 2020

On which iOS version did you manage to reproduce this bug? I tried to reproduce it on iOS 13 and 11 with no luck.

@mateioprea
Copy link
Collaborator Author

mateioprea commented Sep 9, 2020

@yogevbd on iOS 13.7. This is my default options config:

Navigation.setDefaultOptions({
	animations: {
		setRoot: {
			waitForRender: true,
		},
		push: {
			waitForRender: true,
		},
		pop: {
			waitForRender: true,
		},
		setStackRoot: {
			waitForRender: true,
		},
		showModal: {
			waitForRender: true,
		},
		dismissModal: {
			waitForRender: true,
		},
	},
	topBar: {
		searchBar: false,
		searchBarHiddenWhenScrolling: true,
		largeTitle: {
			visible: true,
			fontSize: 30,
			color: COLORS.DARK_BLUE_600,
			fontFamily: FONTS.ProximaNova_ExtraBold,
		},
		hideNavBarOnFocusSearchBar: false,
		backButton: {
			color: COLORS.DARK_BLUE_600,
		},
		rightButtonColor: COLORS.DARK_BLUE_600,
		title: {
			fontSize: 16,
			fontFamily: 'SFProText-Semibold',
			color: COLORS.DARK_BLUE_600,
		},
		noBorder: true,
		visible: true,
		drawBehind: true,
		animate: false,
		background: {
			color: COLORS.BACKGROUND_GRAY,
		},
		borderColor: COLORS.BACKGROUND_GRAY,
	},
});

After this is set up, when you push from a screen that doesn't have a title to another one, the app will crash.

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.

3 participants