-
Notifications
You must be signed in to change notification settings - Fork 24.5k
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
[Android] Style with alignText property "right" error #2702
Comments
cc @mkonicek I can repro this with center alignment too. |
This is for TextInput right? According to the docs |
@kmagiera I encountered this error in a |
there is discrepancy in the way we handle this for Text and InputText. For Text we just use strings on android so there is no need for the value to be converted. For InputText we use enum and we send number over the bridge. Redbox here is caused by native code trying to read number while string is provided. Are you also getting a redbox because of that with Text component, if so can you send a stacktrace? |
@kmagiera oh you're right. this was a TextInput component ( |
Is there any workaround for this? |
Just use allowed values: 'center', 'start' or 'end' |
I got it to work... BUT, my error is that I was trying to use the property in the CSS. It does not work there, you must use it as an attribute of TextInput directly. Home it is going to work in CSS someday. |
Interestingly this also affects iOS somehow. My code is:
This works well (but feels wrong) on both platforms but iOS presents a warning:
If the value is changed to 'end' for iOS, too, RN 0.16.0 throws an exception:
|
@theoriginalgri this issue should be solved by #4481 On iOS at the moment you should st |
And the end goal is to unify that for android too, so after #4481 is merged we should only use textAlign as a part of style map as opposed to passing it as a component property directly |
Summary: change `setTextAlign` and `setTextAlignVertical` to receive argument of type `String` (the same as in `StyleSheet`), so that native props and stylesheet props are calling the same ReactMethod - add demo (may not be necessary) Closes #4481 Reviewed By: svcscm Differential Revision: D2823456 Pulled By: mkonicek fb-gh-sync-id: 349d17549f419b5bdc001d70b583423ade06bfe8
Summary: change `setTextAlign` and `setTextAlignVertical` to receive argument of type `String` (the same as in `StyleSheet`), so that native props and stylesheet props are calling the same ReactMethod - add demo (may not be necessary) Closes facebook/react-native#4481 Reviewed By: svcscm Differential Revision: D2823456 Pulled By: mkonicek fb-gh-sync-id: 349d17549f419b5bdc001d70b583423ade06bfe8
When using a style property of textAlign: "right", I get the following error on Android. It is working in iOS.
The text was updated successfully, but these errors were encountered: