react-native-community / releases

React Native releases
https://github.com/facebook/react-native/
1.5k stars 405 forks source link

Textinput refresh placeHolder clear keyboardInfo #155

Closed xgAnd closed 4 years ago

xgAnd commented 4 years ago

Bug

Environment info

System: OS: macOS Mojave 10.14.6 CPU: (4) x64 Intel(R) Core(TM) i5-4278U CPU @ 2.60GHz Memory: 33.90 MB / 8.00 GB Shell: 3.2.57 - /bin/bash Binaries: Node: 12.3.1 - ~/.nvm/versions/node/v12.3.1/bin/node Yarn: 1.12.3 - /usr/local/bin/yarn npm: 6.9.0 - ~/.nvm/versions/node/v12.3.1/bin/npm Watchman: 4.9.0 - /usr/local/bin/watchman SDKs: iOS SDK: Platforms: iOS 12.4, macOS 10.14, tvOS 12.4, watchOS 5.3 Android SDK: API Levels: 21, 23, 24, 25, 26, 27, 28 Build Tools: 23.0.1, 23.0.2, 25.0.0, 25.0.2, 25.0.3, 26.0.0, 26.0.1, 26.0.2, 26.0.3, 27.0.0, 27.0.3, 28.0.0, 28.0.2, 28.0.3, 29.0.0, 29.0.1 System Images: android-P | Google APIs Intel x86 Atom IDEs: Android Studio: 3.5 AI-191.8026.42.35.5977832 Xcode: 10.3/10G8 - /usr/bin/xcodebuild npmPackages: react: 16.9.0 => 16.9.0 react-native: 0.61.4 => 0.61.4

React native info output:

 // paste it here

Library version: x.x.x

Steps To Reproduce

1.componentDidMount setInterval one second refresh TextInput placeHolder content

  1. TextInput setValue from onChangeText the keyboard will clear info one second ...

Describe what you expected to happen:

1.keyboard write info not clear 2.when select keyboard write info use this change placheHolder content this function can work on version 0.58.6

Reproducible sample code

componentDidMount() { let _this = this; setInterval(() => { _this.setState({ placeTxt:'placeTxt' + Math.random() }); }, 1000); }

renderText=() => { console.log('renderText'); return( <TextInput style = {style.input_phone_input} onChangeText = {(text) => { this.setState({phone:text}); }} selectionColor={'white'} maxLength = {11} value = {this.state.phone} placeholder={this.state.placeTxt} placeholderTextColor = {'white'}

        />
    );
}

render() { return( <View style={{height:300,width:'100%'}}> {this.renderText()} ); }

can show it

xgAnd commented 4 years ago

errorss

rightss

sunnylqm commented 4 years ago

Issues should be posted in main repo instead of here.

xgAnd commented 4 years ago

Issues should be posted in main repo instead of here.

thank you i do not know why error i post on there.