react-native-simple-radio-button icon indicating copy to clipboard operation
react-native-simple-radio-button copied to clipboard

how to disable radio button(By default)

Open atchuthsai468 opened this issue 7 years ago • 5 comments

By default radio button will be disable when user clicks on edit button radio button will be enable for example in <Input editable={false} /> <Input ref={c => (this.city = c)} value={this.state.patientsList.city} returnKeyType="next" placeholderTextColor="#464F54" autoCapitalize="words" style={Styles.textInputStyle} placeholder="City" editable={false} autoCorrect={false} onChangeText={this.handleCity} underlineColorAndroid="transparent" onSubmitEditing={() => this.zipCode._root.focus()} /> <RadioForm radio_props={this.state.radio_props} initial={num} buttonSize={10} borderWidth={0.5} formHorizontal={true} buttonOuterSize={20} labelHorizontal={true} onPress={this.radioButtonFunc.bind(this)} /> screen shot 2017-12-23 at 10 14 24 am

atchuthsai468 avatar Dec 23 '17 04:12 atchuthsai468

I am looking for this type of functionality, would be nice if we could have such functionality :)

varqasim avatar Apr 01 '18 17:04 varqasim

You can pass disabled props to RadioButtonLabel and RadioButtonInput. If it is disabled it won't call the onPress function. For example, I am doing something like

<RadioButton>
  <RadioButtonLabel
      {...otherRadioButtonLabelProps}
      disabled={shouldDisable}
  />
  <RadioButtonInput
      {...otherRadioButtonInputProps}
      disabled={shouldDisable}
      buttonInnerColor={shouldDisable ? '#EEE' : '#000'}
      buttonOuterColor={shouldDisable ? '#EEE' : '#000'}
  />
</RadioButton>

echeon avatar Apr 26 '18 20:04 echeon

<RadioForm radio_props={radio_props} initial={null} onPress={(value) => {this.setState({value:value})}} /> </View

omererbil avatar Jul 16 '18 15:07 omererbil

I found that if I set the RadioForm to be disabled, it works.

<RadioForm disabled = {true} />

xufeipyxis avatar Oct 09 '18 07:10 xufeipyxis

I found that if I set the RadioForm to be disabled, it works.

<RadioForm disabled = {true} />

This solution worked for me. Tks!

victorwvieira avatar May 31 '20 16:05 victorwvieira