Skip to content

[iOS] Fix getCurrentlyVisibleScreenId with drawer#2052

Merged
yogevbd merged 3 commits into
wix:masterfrom
Royce:fix-getcurrentlyvisiblescreenId-ios-with-drawer
Dec 24, 2017
Merged

[iOS] Fix getCurrentlyVisibleScreenId with drawer#2052
yogevbd merged 3 commits into
wix:masterfrom
Royce:fix-getcurrentlyvisiblescreenId-ios-with-drawer

Conversation

@Royce
Copy link
Copy Markdown
Contributor

@Royce Royce commented Oct 20, 2017

This fixes two issues with Navigation.getCurrentlyVisibleScreenId and this.props.navigator.screenIsCurrentlyVisible() on iOS.

  • The wrong "controllerId" was being set for the initial screen/layout. controllerId is only used to return a screenId for Navigation.getCurrentlyVisibleScreenId.
  • Take into account drawers, when trying to find the visible viewController.

@Royce
Copy link
Copy Markdown
Contributor Author

Royce commented Oct 20, 2017

Fixes #1728

@rynop
Copy link
Copy Markdown

rynop commented Dec 22, 2017

@Royce this.props.navigator.screenIsCurrentlyVisible() is still always false for me on iOS. react-native-navigation v1.1.316. I'm not using drawer mode, I'm only using Navigation.startTabBasedApp().

I've tried using this.props.navigator.screenIsCurrentlyVisible() both on a screen that is opened from a tab AND a screen that is opened in a modal.

Whats strange is calling const visibleScreenInstanceId = await Navigation.getCurrentlyVisibleScreenId() always returns a strange screen id like controllerID1_nav0 instead of the screen ID that i registered via Navigation.registerComponent('my.screen', () => ThingFinder, store, Provider);

@guyca guyca requested a review from yogevbd December 23, 2017 06:48
@Royce
Copy link
Copy Markdown
Contributor Author

Royce commented Dec 23, 2017 via email

@yogevbd yogevbd merged commit 2c30a52 into wix:master Dec 24, 2017
guyca added a commit that referenced this pull request Dec 24, 2017
guyca added a commit that referenced this pull request Dec 24, 2017
… iOS" (#2404)

* Revert "Improve getCurrentlyVisibleScreenId on iOS with drawers. (#2052)"

This reverts commit 2c30a52.

* Revert "introducing navbar shadow on iOS (#2339)"

This reverts commit 8fd496e.

* Revert "This fixes an issue with a custom title-view (which has a title and a subtitle) appearing at the left side of the nav-bar instead of the center during a transition animation: when a screen with this title-view is being pushed or when you pop back to it. (#2384)"

This reverts commit 3f7f6c2.

* Revert "Now allowing the custom nav bar to take up the whole space on iOS (#2306)"

This reverts commit 74a02cc.
@rynop
Copy link
Copy Markdown

rynop commented Dec 24, 2017

@Royce thanks makes sense. I didn't notice this PR was not merged into master yet, so crossing fingers this.props.navigator.screenIsCurrentlyVisible() is fixed (not always return false) in non-tabbed mode.

chilinh added a commit to chilinh/react-native-navigation that referenced this pull request Jan 2, 2018
* r_master:
  fixes wix#2353
  Update third-party-libraries-support.md
  [docs] Update minimum officially supported RN version
  Don't override LightBox ReactRootView id
  Update example app to rn51
  Revert "fix images name (wix#2451)"
  Revert "Upgrade example proj to rn51 (wix#2452)"
  Upgrade example proj to rn51 (wix#2452)
  fix images name (wix#2451)
  fixed buttons text attributes revert on press
  Fix a uncommented line (wix#2226)
  Support re-enabling top bar elevation (wix#2229)
  Document how to use index.js as entry point (wix#2412)
  Revert "Now allowing the custom nav bar to take up the whole space on iOS" (wix#2404)
  Improve getCurrentlyVisibleScreenId on iOS with drawers. (wix#2052)
  introducing navbar shadow on iOS (wix#2339)
  This fixes an issue with a custom title-view (which has a title and a subtitle) appearing at the left side of the nav-bar instead of the center during a transition animation: when a screen with this title-view is being pushed or when you pop back to it. (wix#2384)
krystofcelba pushed a commit to krystofcelba/react-native-navigation that referenced this pull request Jan 4, 2018
krystofcelba pushed a commit to krystofcelba/react-native-navigation that referenced this pull request Jan 4, 2018
… iOS" (wix#2404)

* Revert "Improve getCurrentlyVisibleScreenId on iOS with drawers. (wix#2052)"

This reverts commit 2c30a52.

* Revert "introducing navbar shadow on iOS (wix#2339)"

This reverts commit 8fd496e.

* Revert "This fixes an issue with a custom title-view (which has a title and a subtitle) appearing at the left side of the nav-bar instead of the center during a transition animation: when a screen with this title-view is being pushed or when you pop back to it. (wix#2384)"

This reverts commit 3f7f6c2.

* Revert "Now allowing the custom nav bar to take up the whole space on iOS (wix#2306)"

This reverts commit 74a02cc.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants