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

Most upvoted comments

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: screen shot 2016-04-23 at 17 46 05

@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.