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

refactor: simplify RTL handling in tab controller components #3456

Merged
merged 2 commits into from
Dec 12, 2024

Conversation

adids1221
Copy link
Contributor

@adids1221 adids1221 commented Dec 11, 2024

Description

TabController support RTL on IOS and Android.
After the RN 73 upgrade there isn't and RTL issue on Android but on IOS.
Fixing the issue in TabController by reversing the selected index when using RTL on IOS.

Changelog

TabController support RTL on IOS and Android.

Additional info

MADS-4571

@adids1221
Copy link
Contributor Author

@ethanshar Iv'e checked it both on Android and IOS, also on the private repo (7.34.5-snapshot.5922).

Copy link
Collaborator

@ethanshar ethanshar left a comment

Choose a reason for hiding this comment

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

Looks good, wrote a small comment

@@ -177,12 +178,13 @@ const useScrollToItem = <T extends ScrollToSupportedViews>(props: ScrollToItemPr

const focusIndex = useCallback((index: number, animated = true) => {
if (index >= 0 && offsets.CENTER.length > index) {
const rtlIndex = Constants.isRTL && Constants.isIOS ? itemsCount - index - 1 : index;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Let's move Constants.isRTL && Constants.isIOS to a const at the top of the file like we did before so it's easier to spot there's an RTL fix

@M-i-k-e-l M-i-k-e-l merged commit 8e681fe into master Dec 12, 2024
1 check passed
@M-i-k-e-l M-i-k-e-l deleted the fix/TabController_RTL_ios_issue branch December 12, 2024 09:47
M-i-k-e-l added a commit that referenced this pull request Dec 12, 2024
* refactor: simplify RTL handling in tab controller components

* Move to FIX_RTL const

---------

Co-authored-by: M-i-k-e-l <[email protected]>
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.

3 participants