Comments (11)
The above code mentioned is unfortunately only used in the legacy architecture. The new architecture has a different path for setting text direction, though I think it may also do some swapping (though IIRC maybe only when swapLeftAndRightInRTL
is enabled, which I think is default too).
from react-native.
@cortinico I can pick this up, but had a few points.
those are good questions for @necolas
from react-native.
Hello, Can I try to resolve this issue?
from react-native.
@cortinico I can pick this up, but had a few points.
If we are to match web specs, then the way left
and right
currently behave don't work according to the specs. It internally checks whether the direction is RTL or LTR, and applies the opposite.
According to the CSS spec:
left
aligns the text to theleft
of the bounding boxright
aligns the text to theright
of the bounding boxstart
aligns the text to theleft
if LTR andright
if RTLend
aligns the text to theright
if LTR andleft
if RTL
Based on this, I can see two ways to do it:
- Either accommodate for this change in the
Text
component itself - Fix this in the base text shadow node to match the spec
Which one would you recommend?
from react-native.
@necolas whenever you can, if you can validate these points then I will make the fix accordingly.
I have already done the same for Android, but awaiting confirmation will do the for iOS.
from react-native.
then the way left and right currently behave don't work according to the specs. It internally checks whether the direction is RTL or LTR, and applies the opposite
Fixing this might be a breaking change if you're saying left
currently becomes right
in an RTL context.
should react to the
direction
style on ancestral Views
I think the fix to the way direction
works on Android is behind a feature flag. cc @NickGerleman
from react-native.
What do you recommend?
I am particularly referring to these lines:
I suspect something similar will also be there for iOS. If we add start
and end
support, do we just swap it out for left
and right
, or actually follow the spec and implement it as per it?
from react-native.
@NickGerleman in that case, can you point me to where this would be?
@necolas Should the fix for this be inline with CSS spec? If so then I will start accordingly.
from react-native.
@necolas Hello, any update on this? I can pick this up accordingly.
from react-native.
Yes, inline with CSS spec
from react-native.
Cool, sorry for the delay was unwell. I'll pick this up over this weekend!
from react-native.
Related Issues (20)
- [BUG] - Can't Build project on iOS 15, throws "RCT_ENABLE_INSPECTOR needs to be set to fulfill RCT_REMOTE_PROFILE" HOT 4
- React Native CLI - Error "configureCMakeDebug[arm64-v8a]" [CXX1410]
- The commander dependency is missing in the react-native package HOT 2
- ImageSource is now open for inheritance but the getUri method is still final and cannot override it HOT 3
- App not covering fulll device height HOT 5
- When using TextInput with secureTextEntry={true} on iOS, pressing the back button erases the entire text instead of just the last character. HOT 5
- 'getUri()' cannot override 'getUri()' in 'com.facebook.react.views.imagehelper.ImageSource'; overridden method is final HOT 3
- React Native 0.74.0 - Getting issue on production build -Crashed: Thread: SIGSEGV 0x0000006df6aebf90 HOT 5
- FlatList Items Not Occupying Full Screen Height with Paging Enabled HOT 3
- [Android] ScrollView does not properly handle `testID` property
- Application Scene Delegates support in RN >= 0.74 HOT 4
- How to initialize a react-native app of version 0.75.2 in year 2024? HOT 4
- Codegen resolves wrong dependency in multi-app monorepo; when apps specify different versions of same dep (ios) HOT 4
- Why support only Ukraine but not Palestine?Either support both or support neither. Why bring selective support into technology? HOT 4
- Tried to show an alert while not attached to an Activity HOT 2
- Unable to use Hermes engine in fresh CLI project
- [email protected] / Android / New Arch - Bug
- ForceRTL(false) is not working as intended HOT 4
- Bug: TextInput with multiline and lineHeight has height issue when controlled HOT 2
- [[email protected]] `yoga/style/Style.h` file not found
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native.