From acf1ef7db256a0b182e724ee8316bb9d0ff987cd Mon Sep 17 00:00:00 2001 From: rahmed Date: Thu, 6 May 2021 01:02:31 -0500 Subject: [PATCH] add disable functionality for radio buttons --- README.md | 1 + RadioButtonRN.js | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 606f34b..ea60b7f 100644 --- a/README.md +++ b/README.md @@ -69,6 +69,7 @@ see this simple [example](https://github.com/sramezani/radio-buttons-react-nativ | boxActiveBgColor | background color of active item, when box is true | '#e1f5fe33' | | boxDeactiveBgColor | background color of deactive items, when box is true | '#fff' | | textColor | label color | '#383838' | +| disabled | flag to disable radio buttons | false | # Contributing Yes of course! Welcome :) diff --git a/RadioButtonRN.js b/RadioButtonRN.js index 4756e29..c469544 100644 --- a/RadioButtonRN.js +++ b/RadioButtonRN.js @@ -116,7 +116,7 @@ class RadioButtonRN extends React.Component { render() { let { activeIndex, fadeAnim, animations } = this.state; - let { boxStyle, style, circleSize, textStyle, data, icon, activeColor, deactiveColor, boxActiveBgColor, boxDeactiveBgColor, box, textColor } = this.props; + let { boxStyle, style, circleSize, textStyle, data, icon, activeColor, deactiveColor, boxActiveBgColor, boxDeactiveBgColor, box, textColor, disabled } = this.props; return ( @@ -133,6 +133,7 @@ class RadioButtonRN extends React.Component { , boxStyle]} activeOpacity={0.9} onPress={() => this._changeRadio(item, index)} + disabled={disabled} >