React-native: [TextInput] fontWeight and fontStyle are not applied to TextInput (v0.8.0)

Created on 27 Jul 2015  路  17Comments  路  Source: facebook/react-native

See https://rnplay.org/apps/PDWePA to reproduce the bug.

Locked

Most helpful comment

Hmm I'm still seeing this issue on RN 0.39 (which was released Dec 1st, after the fix was committed...).
Are other people getting this working?

All 17 comments

@sahrens, this might be related to your recent changes to TextInput

I've run into this as well.

Looks like this is an iOS-only problem, and only occurs with multiline={false} (which is the default).

I haven't touched iOS for a while - @nicklockwood, can you take a look?

Sorry for the super slow response, this totally fell off my radar and most of the syled inputs we have been using are all multiline so we didn't notice internally.

I've done some playing around with this, and there are a few unexpected behaviors:

  • You must have multiline={true} to apply any font styling.
  • fontWeight and fontStyle applied simultaneously will cause neither to be applied
  • Setting fontSize will strip any font weight styling.

You can see some examples in play here:
https://rnplay.org/apps/iiZDsA

screen shot 2016-04-24 at 01 14 37

Looks like it works :)

@christophermark any chance you'd be willing to submit a PR for this? @grabbou what do you think next steps ought to be?

It's actually quite frustrating that it can't get fixed for a year already.

@javache or @mmmulani - do you guys have time to take a look? Pretty buggy.

Fix up internally.

Hmm I'm still seeing this issue on RN 0.39 (which was released Dec 1st, after the fix was committed...).
Are other people getting this working?

I'm still seeing this issue on 0.49.0

@bsiddiqui So, fontWeight and fontStyle do not work with for you? iOS or Android?

@shergin iOS, yeah fontWeight doesn't work unless I make the TextInput multiline

@bsiddiqui Oh, that's a bummer. 馃槩 Only fontWeight?
Could you please create a new issue for that, add a Snack example, and cc me?
cc @rigdern

@bsiddiqui can you share a snippet? I tried to make my TextInput multiline but fontWeight still does not apply.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

aniss picture aniss  路  3Comments

axelg12 picture axelg12  路  3Comments

lazywei picture lazywei  路  3Comments

despairblue picture despairblue  路  3Comments

josev55 picture josev55  路  3Comments