react-native-button-component icon indicating copy to clipboard operation
react-native-button-component copied to clipboard

Initially disabled button won't enabled after

Open tavrez opened this issue 7 years ago • 1 comments

  OS: Windows 10
  Node: 8.11.3
  Yarn: 1.9.2
  npm: 6.2.0
  Watchman: Not Found
  Xcode: N/A
  Android Studio: Not Found

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

react-native-button-component: 0.2.28

Using this code:

import React, { Component } from 'react';
import {
  StyleSheet,
  View,
  TextInput,
} from 'react-native';
import { RoundButton } from 'react-native-button-component';

export default class App extends Component<Props> {
  constructor(props){
	  super(props);
	  this.state = {password:''};
  }
  render() {
	let {password} = this.state;
    return (
      <View style={styles.container}>
        <TextInput onChangeText={(password) => this.setState({password})} value={password}/>
	<RoundButton text='Submit' disabled={!password}/>
      </View>
    );
  }
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: 'center',
    alignItems: 'center',
}});

When state is initiated with empty value, the RoundButton get disabled but won't become enabled after. However, if you set initial state to non-empty, it works as expected(disabled when input become empty) Edit: Tested on Android Edit 2 : same as #26 but it's not fixed(as discussed there)

tavrez avatar Jul 29 '18 19:07 tavrez

Any help?

tavrez avatar Aug 11 '18 11:08 tavrez