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): load initial tab when onSwitchToTab mode is set. #7924

Merged
merged 1 commit into from
Oct 16, 2024

Conversation

asafkorem
Copy link
Collaborator

@asafkorem asafkorem commented Oct 16, 2024

Setting the initial tab index before the initialization doesn't work, since it resets to the default value (0) after initializing the tab bar controller.

Also, it seems that it loads the default child from index 0 regardless of setting it a default. I tried to workaround this from different steps in the lifecycle of the controller but looks like there's a deeper problem here. need to investigate.

Setting the initial tab index before the initialization doesn't work, since it resets
 to the default value (0) after initializing the tab bar controller.

It also seems that it loads the default child from index 0 regardless of setting it a
 default. I tried to workaround this from different steps in the lifecycle of the
 controller but looks like there's a native issue there.
@asafkorem asafkorem self-assigned this Oct 16, 2024
@asafkorem asafkorem merged commit 292eee5 into master Oct 16, 2024
5 of 8 checks passed
@asafkorem asafkorem deleted the fix/switchToTab-issue branch October 16, 2024 13:39
asafkorem added a commit that referenced this pull request Oct 16, 2024
This fixes the issue mentioned on #7921, #7922 and #7924.

Changing the `selectedIndex` will not have any effect before the setup has finished,
 the original issue was the method `setSelectedIndex` was called immediately when calling
 to the `super` initializer with a `0` value regardless of the initial `currentTab`.

This prevents the loading of the tab from index `0` regardless of the custom initial rendered tab.
asafkorem added a commit that referenced this pull request Oct 16, 2024
)

This fixes the issue mentioned on #7921, #7922 and #7924.

Changing the `selectedIndex` will not have any effect before the setup has finished,
 the original issue was the method `setSelectedIndex` was called immediately when calling
 to the `super` initializer with a `0` value regardless of the initial `currentTab`.

This prevents the loading of the tab from index `0` regardless of the custom initial rendered tab.
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.

1 participant