mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-03-26 07:04:05 +08:00
add maximumValue and minimumValue as valid attributes for native Slider
Summary: Noticed that the minimumValue and maximumValue for the SliderIOS component isn't actually picked up by the native slider that gets rendered. Issue #442 Closes https://github.com/facebook/react-native/pull/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)  
This commit is contained in:
@@ -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}
|
||||
/>
|
||||
);
|
||||
@@ -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',
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user