React-native-navigation: [v2] Can't remove topBar subtitle (and re-align topBar title)

Created on 30 Nov 2018  路  5Comments  路  Source: wix/react-native-navigation

Issue Description

When you've set a subtitle, there is no way to remove the subtitle, and have the title go back to full size.

Steps to Reproduce / Code Snippets / Screenshots

A full size title:
image

A title with a sub title:
image

A title that had a sub title, and it's now been removed (note the size of the title, and the space between title and edge of bar):
image

I believe you can reproduce this by doing the following:

Navigation.mergeOptions(this.props.componentId, {
  topBar: {
    title: {
      text: 'My Title',
    },
    subtitle: {
      text: 'My Subtitle',
    },
  }
});

Navigation.mergeOptions(this.props.componentId, {
  topBar: {
    title: {
      text: 'My Title',
    },
    subtitle: {
      text: '',
    },
  }
});

I have tried setting the whole subtitle object to undefined (it just remains on the screen regardless), null (it breaks and complains that null is not a valid option) and also setting the subtitle.text option to undefined and null with the same results (stays visible, or crashes the app)


Environment

  • React Native Navigation version: 2.1.3
  • React Native version: 0.57.3
  • Platform(s) (iOS, Android, or both?): iOS (maybe both - haven't checked android)
  • Device info (Simulator/Device? OS version? Debug/Release?): Simulator, iPhone X, iOS 12
iOS acceptebug good first task 馃搶 pinned

Most helpful comment

Just dropping by to say that the bug is still there.

All 5 comments

@guyca I noticed the same thing that there is no way to remove subtitle once it is added. We have faced same issues that we would like to remove subtitle at specific point. Can you guys check this out?

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
If you believe the issue is still relevant, please test on the latest Detox and report back. Thank you for your contributions.

This is definitely not stale. It just hasn't been looked at by anyone.

Just dropping by to say that the bug is still there.

Fixed by #5883 (auto close in PR didn't work)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kiroukou picture kiroukou  路  3Comments

EliSadaka picture EliSadaka  路  3Comments

edcs picture edcs  路  3Comments

zagoa picture zagoa  路  3Comments

yayanartha picture yayanartha  路  3Comments