software-mansion / react-native-screens

Native navigation primitives for your React Native app.
https://docs.swmansion.com/react-native-screens/
MIT License
3.02k stars 513 forks source link

headerLargeTitle & headerSearchBarOptions Doesn't Support RTL #1884

Closed Wahsner closed 3 months ago

Wahsner commented 1 year ago

Description

When RTL is enabled, the headerLargeTitle & headerSearchBarOptions don't honour the text direction. Instead they remain LTR as shown in the below screen cuttings.

headerLargeTitle image headerSearchBarOptions(focused) image

I would expect them to be positioned right as shown below (taken from the contacts app)

Large Title image Search bar(focused) image

Steps to reproduce

  1. Set the options direction: 'rtl'
  2. Not sure if required, but Set I18nManager.forceRTL(true); in the App.js too
  3. Restart the app by closing it completely from background and re-launching

Expected

Actual

Snack or a link to a repository

https://github.com/0xRenshaw/react-native-screens/tree/main/FabricExample

Screens version

3.25.0

React Native version

0.72.4

Platforms

iOS

JavaScript runtime

None

Workflow

React Native (without Expo)

Architecture

Paper (Old Architecture)

Build type

Release mode

Device

Real device

Device model

No response

Acknowledgements

Yes

tboba commented 1 year ago

Hi @0xRenshaw, thank you for reporting this issue! I've managed to reproduce this problem - I'll open a PR that solves it shortly.

Screenshot 2023-09-20 at 10 12 25
moedeveloper commented 11 months ago

what is the fix, i am still having the same issue ?

Wahsner commented 11 months ago

what is the fix, i am still having the same issue ?

It has been merged to master. There hasn't yet been a release.

tboba commented 11 months ago

Hi @0xRenshaw @moedeveloper, there's a new version of react-native-screens: 3.26.0 which has this change included. Check it out! If you find something wrong related to the newest version (this change is still buggy or doesn't work for you) let us know 🎉

STonkoshkur commented 7 months ago

@tboba the back button direction is still incorrect in RTL for iOS. I'm running the example application from Example directory using Xcode 15.2

image
tboba commented 7 months ago

@STonkoshkur interesting, do you have some native apps that have RTL mode enabled? I just wanted to see how the back button should look like. In my case, I have the same back button as you, but if I unhide the default navigation bar of the navigation controller, it looks completely the same 🤔

image
tboba commented 7 months ago

Reopening the issue, since something has broke in iOS 17.2 that has broke the back button in RTL mode.

Expected behavior: image

github-actions[bot] commented 7 months ago

Hey! 👋

The issue doesn't seem to contain a minimal reproduction.

Could you provide a snack or a link to a GitHub repository under your username that reproduces the problem?

tboba commented 7 months ago

I believe that potentially the bug with back button might occur also in iOS native apps. I've found on Apple forums that someone has the same problem - https://developer.apple.com/forums/thread/737855. @STonkoshkur could you check if on the non-system native apps the issue with back button is the same?

serhiitonkoshkur commented 7 months ago

@tboba I've checked several non-system iOS apps and the back button is working fine (iOS 17.2.1)

alduzy commented 3 months ago

I can confirm the back arrow faces correct direction after changing the application's CFBundleDevelopmentRegion. Looks as if the I18nManager.forceRTL(true) does not force the change.

developmentRegion = ar developmentRegion = en
Screenshot 2024-06-12 at 12 41 14 Screenshot 2024-06-12 at 12 42 33
Screenshot 2024-06-12 at 12 41 27 Screenshot 2024-06-12 at 12 42 46

It's worth noticing that the Text element's alignment is not changing properly - only flexDirection of View element changes: Screenshot 2024-06-12 at 12 33 10