Skip to content

fix: invalid header background colour - #1560

Merged
kkafar merged 5 commits into
mainfrom
@kkafar/fix-1391
Aug 17, 2022
Merged

kkafar merged 5 commits into
mainfrom
@kkafar/fix-1391

Conversation

@kkafar

@kkafar kkafar commented Aug 16, 2022 •

Copy link
Copy Markdown
Member

Description

Fixes #1391
Fixes #1477

The code added in #1228 did not handle case when both view controller and "next view controller" were null as they are most of the times (in tested scenario -> Test1391)! This caused view controller to be updated almost every time, which counter-intuitively leaded to invalid header state.

It is not clear to me why it was the case, as it would seem to me that updating view controller more frequently would rather lead to more up-to-date header state, however it is not the case.

Note 1: The issue did not appear on iOS 15+ (everything works just fine there)
Note 2: I reproduced & fixed it using simulator with iOS 13.2 (but it still works on more recent iOS too)
Note 3: While debugging, it occurred to me that there are some concurrency issues in this code (RNSScreenStackHeaderConfig#updateViewControllerIfNeeded). As I was repeatedly opening & closing modal view this method was executed with various configurations of nonnull & null values for _screenView.controller, vc.parentViewController, etc. This most likely requires further investigation.
Note 4: I also ensured that the problem resolved by #1228 was not brought back.

Changes

Added checks for case when both view controller and next view controller are null (see the code).

Test code and steps to reproduce

Test1391 in test examples.

Checklist

  • Included code example that can be used to test this change
  • Ensured that CI passes

@kkafar kkafar changed the title fix: 1391 fix: WIP 1391 Aug 16, 2022
@kkafar
kkafar force-pushed the @kkafar/fix-1391 branch 2 times, most recently from 6331f3f to 80e4a27 Compare August 16, 2022 11:49
@kkafar kkafar changed the title fix: WIP 1391 fix: invalid header background colour Aug 17, 2022
@kkafar
kkafar marked this pull request as ready for review August 17, 2022 07:15
@kkafar
kkafar requested a review from WoLewicki August 17, 2022 07:15

@WoLewicki WoLewicki left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM 🎉

@kkafar
kkafar merged commit b16fcea into main Aug 17, 2022
@kkafar
kkafar deleted the @kkafar/fix-1391 branch August 17, 2022 08:58
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.

Header backgroud color is gray/white intead of specified in screenOptions Header in modal is sometimes missing background on iOS 13 & 14

2 participants