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

Initially disabled button won't enabled after #35

Open
tavrez opened this issue Jul 29, 2018 · 1 comment
Open

Initially disabled button won't enabled after #35

tavrez opened this issue Jul 29, 2018 · 1 comment

Comments

@tavrez
Copy link

tavrez commented Jul 29, 2018

  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
Copy link
Author

tavrez commented Aug 11, 2018

Any help?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant