react-native: Docs for TextInput don't say what styles it can take, incorrectly hint that they can handle all Text styles
According to the docs for TextInput it supports the same styling options as Text. In testing this at the bare minimum all of the shadow and line decoration options aren’t supported.
This can be seen in this playground:
https://rnplay.org/apps/sdqbqw
If the Text
element is replaced with a TextInput
element with the same style the shadow is lost.
I can imagine that the native text input element isn’t conducive to supporting shadows, which is why this is happening.
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Reactions: 6
- Comments: 19 (9 by maintainers)
Commits related to this issue
- Update docs on TextInput:style to point to relevant issue Bandaid for #7070. Until this is fixed, the docs should at least be honest the state they're in, so people don't have to go search and wonder... — committed to xixixao/react-native by xixixao 8 years ago
- Update docs on TextInput:style to point to relevant issue Summary: Bandaid for #7070. Until this is fixed, the docs should at least be honest the state they're in, so people don't have to go search a... — committed to facebook/react-native by xixixao 8 years ago
- Update docs on TextInput:style to point to relevant issue Summary: Bandaid for #7070. Until this is fixed, the docs should at least be honest the state they're in, so people don't have to go search a... — committed to nicktate/react-native by xixixao 8 years ago
- Update docs on TextInput:style to point to relevant issue Summary: Bandaid for #7070. Until this is fixed, the docs should at least be honest the state they're in, so people don't have to go search a... — committed to DanielMSchmidt/react-native by xixixao 8 years ago
- Partial list of unsupported TextInput styles Summary: References #7070 <!-- Thank you for sending the PR! We appreciate you spending the time to work on these changes. Help us understand your motiv... — committed to facebook/react-native by marcind 7 years ago
Given that the docs still don’t actually say which styles will actually work don’t you think closing the issue is premature?
Hi, this is still not resolved: http://facebook.github.io/react-native/releases/0.50/docs/textinput.html Please reopen and throw together a simple bullet point list of what is supported.
Closing this issue because it has been inactive for a while. If you think it should still be opened let us know why.
Hi @hramos ! I am new to Open Source and want to dive into this issue, though i could see you have assigned it to yourself, it is possible you re-assign it to me so i can get started with contributing.
Good point. I’ve been tackling docs issues, so I’ll just assign this to myself.
@dimitrovskif in fact, our docs are saying it accepts the same style https://facebook.github.io/react-native/docs/textinput.html#style
@seanparsons you can wrap your
<TextInput />
children with<Text />
and that will give you all these things. Here’s the relevant line in example app: https://github.com/facebook/react-native/blob/master/Examples/UIExplorer/TextInputExample.ios.js#L228. You can find it in the app under ->TextInput -> Attributed text
(at the end)I think docs need some clarifying.
Here’s the rnplay: https://rnplay.org/apps/EdJtJQ
And image:
@dimitrovskif I’m really not sure what point you’re trying to make, it shouldn’t make any difference what Apple or Google support natively in their controls. The docs should represent what is supported by React Native, leaving everyone to find it out blindly (some of them are explicitly listed as being only available on iOS as well) isn’t a great experience for anyone.