Does the childStyle props still available to customize the textInput style ?
If yes, may i have some example on using the childStyle props because in the documentation from the official website it says that it accepts string type but normally I style with object type
If no, is there any workaround because i failed to change the textAlign
Which version of Paper you are referring to? I cannot see any prop named childStyle on TextInput.
I checked the possibility to change text-align on input and on the current master branch you can change the inputted text's aligning but the label will now change its position. On new incoming 3.0 release text alignment change doesn't work at all, so we will need to work on this before release.
Sorry, I referred to paper v2.15.2. However, after i checked again with the official documentation, the props has been removed and after referring with the file in the node module, it does not accept childStyle props as what you mentioned.
So, I think i probably will close this issue. Thank for your reply
No problem. I've check material design docs and there is no example with the explicit change of text alignment of the input text. The only example is where you use a suffix. Since we have RTL support and we are going to add prefix/suffix support in 3.0 we are probably not going to leave the possibility to change text alignment explicitly.
Please fix this issue asap we are working on a production project and we need this.
Hi @miladmeidanshahi
can you describe what is your case? How you want your TextInput to behave?
Right now we don't support text alignment prop but maybe there is simpler solution for your problem :)
Hi @venits Our app is RTL and all of the text input such az number is in RTL it should be LTR, but we can't do that because text input it does't support.
Do you have any solution?
Hi @miladmeidanshahi
Unfortunately the way textAlign works is as follows:
textAlign: I18nManager.isRTL ? "right" : "left",
There is no option to control it using props or style.
What you can do:
If you need LTR input only for numbers I would create custom TextInput without react-native-paper.
Use default TextInput from react-native:
import { TextInput } from 'react-native';
You can give it some more friendly number input style. In that way you will get full control over your inputs :)
@venits this way it was our last solution the biggest problem is if we import from react-native text input style missed from material design :(
Most helpful comment
Please make
textAlignavailable for TextInput.It's really important.