Skip to content

Commit

Permalink
add maximumValue and minimumValue as valid attributes for native Slider
Browse files Browse the repository at this point in the history
Summary:
Noticed that the minimumValue and maximumValue for the SliderIOS component isn't actually picked up by the native slider that gets rendered. Issue facebook#442

Closes facebook#583
Github Author: Don Yu <donyu8@gmail.com>

Test Plan:
 Add minimumValue and maximumValue prop to <SliderIOS> component in SliderIOSExample.js for UIExplorer (see screenshots)

![sliderios_maximumvalue](https://cloud.githubusercontent.com/assets/1103836/6946764/9ebe8db8-d870-11e4-84e5-7c31a955f9c0.png)
![sliderios_minimumvalue](https://cloud.githubusercontent.com/assets/1103836/6946765/9ec0031e-d870-11e4-8a1b-2371a5aa033a.png)
  • Loading branch information
donyu authored and oss sync committed Apr 12, 2015
1 parent 3a714c3 commit ebcc91d
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion Libraries/Components/SliderIOS/SliderIOS.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ var SliderIOS = React.createClass({
<RCTSlider
style={[styles.slider, this.props.style]}
value={this.props.value}
maximumValue={this.props.maximumValue}
minimumValue={this.props.minimumValue}
onChange={this._onValueChange}
/>
);
Expand All @@ -94,8 +96,15 @@ var styles = StyleSheet.create({
},
});

var validAttributes = {
...ReactIOSViewAttributes.UIView,
value: true,
minimumValue: true,
maximumValue: true,
};

var RCTSlider = createReactIOSNativeComponentClass({
validAttributes: merge(ReactIOSViewAttributes.UIView, {value: true}),
validAttributes: validAttributes,
uiViewClassName: 'RCTSlider',
});

Expand Down

0 comments on commit ebcc91d

Please sign in to comment.