Skip to content
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

[TextInput ][ Android ] fontStyle not updated on component re-render #19592

Closed
4 tasks done
ahetawal-p opened this issue Jun 6, 2018 · 7 comments
Closed
4 tasks done
Labels
Bug Component: TextInput Related to the TextInput component. Platform: Android Android applications. Stale There has been a lack of activity on this issue and it may be closed soon.

Comments

@ahetawal-p
Copy link

ahetawal-p commented Jun 6, 2018

Environment

Environment:
OS: macOS High Sierra 10.13.4
Node: 8.11.1
Yarn: Not Found
npm: 5.7.1
Watchman: 4.7.0
Xcode: Xcode 9.4 Build version 9F1027a
Android Studio: 3.1 AI-173.4720617

Packages: (wanted => installed)
react: 16.3.1 => 16.3.1
react-native: 0.55.4 => 0.55.4

Description

Applying fontStyle dynamically to a TextInput on Android doesn't reflect.

Steps to Reproduce

Here is the sample render function

 const tester = this.state.enteredText.length == 0 ? {fontStyle:'italic'} : {fontStyle:'normal'}
    return (
      <View style={styles.container}>
        <TextInput
         onChangeText={txt => this.setState({enteredText: txt})}
         style={[styles.paragraph, tester]}
         placeholder={'This is a test'}
  />
      </View>
    );

Expected Behavior

When user starts typing the fontStyle should be updated to normal

Actual Behavior

The fontStyle always stick to italic even after the re-render of the TextInput has happened.

@react-native-bot react-native-bot added Platform: Android Android applications. Component: TextInput Related to the TextInput component. labels Jun 6, 2018
@dancherb
Copy link

Having the same issue with a redux-linked TextInput.

@mickadoua
Copy link

i have the same issue
Others Styleq (e.g : color) are correctly applied

If we come back to the same page, the Italic style is applied

here is a video :
placeholder Italic.webm.zip

PS : The same style is applied to Text and TextInput component

@eleeffs
Copy link

eleeffs commented Oct 2, 2018

I am also having similar issue.

I am changing the style of the textInput once there is value then changing it back once the text field has been cleared.

The placeholder text is not fully updating the style. fontSize and color are working as @mickadoua mentioned but things like fontFamily or fontWeight are not changing the placeholder back to the original style.

Here is snak example https://snack.expo.io/By2ijBW5X

@YangXiaomei
Copy link

YangXiaomei commented Oct 18, 2018

I have the same issue.

It works on iOS, but not works on Android.

@stale
Copy link

stale bot commented Jan 16, 2019

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as "For Discussion" or "Good first issue" and I will leave it open. Thank you for your contributions.

@stale stale bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Jan 16, 2019
@stale stale bot removed the Stale There has been a lack of activity on this issue and it may be closed soon. label Jan 24, 2019
@hramos hramos removed the Bug Report label Feb 6, 2019
@stale
Copy link

stale bot commented Aug 2, 2019

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as a "Discussion" or add it to the "Backlog" and I will leave it open. Thank you for your contributions.

@stale stale bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Aug 2, 2019
@stale
Copy link

stale bot commented Aug 9, 2019

Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information.

@stale stale bot closed this as completed Aug 9, 2019
@facebook facebook locked as resolved and limited conversation to collaborators Aug 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Component: TextInput Related to the TextInput component. Platform: Android Android applications. Stale There has been a lack of activity on this issue and it may be closed soon.
Projects
None yet
Development

No branches or pull requests

7 participants