mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-28 12:15:37 +08:00
added property to sliderIOS to be able to disable it
Summary: added a new property named 'disable' to SliderIOS this property prevents the user from being able to slide the slider Closes https://github.com/facebook/react-native/pull/3730 Reviewed By: svcscm Differential Revision: D2590154 Pulled By: javache fb-gh-sync-id: b8a9c82c1b05eb813d9b81180cb1083b3f1852ac
This commit is contained in:
committed by
facebook-github-bot-4
parent
8185b203be
commit
7d4f5a5c47
@@ -63,6 +63,12 @@ var SliderIOS = React.createClass({
|
||||
*/
|
||||
maximumTrackTintColor: PropTypes.string,
|
||||
|
||||
/**
|
||||
* If true the user won't be able to move the slider.
|
||||
* Default value is false.
|
||||
*/
|
||||
disabled: PropTypes.bool,
|
||||
|
||||
/**
|
||||
* Callback continuously called while the user is dragging the slider.
|
||||
*/
|
||||
@@ -86,6 +92,12 @@ var SliderIOS = React.createClass({
|
||||
}
|
||||
},
|
||||
|
||||
getDefaultProps: function() : any {
|
||||
return {
|
||||
disabled: false,
|
||||
};
|
||||
},
|
||||
|
||||
render: function() {
|
||||
return (
|
||||
<RCTSlider
|
||||
@@ -95,6 +107,7 @@ var SliderIOS = React.createClass({
|
||||
minimumValue={this.props.minimumValue}
|
||||
minimumTrackTintColor={this.props.minimumTrackTintColor}
|
||||
maximumTrackTintColor={this.props.maximumTrackTintColor}
|
||||
disabled={this.props.disabled}
|
||||
onChange={this._onValueChange}
|
||||
/>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user