react-native-slider-picker
Advanced tools
Comparing version 1.0.46 to 1.0.47
{ | ||
"name": "react-native-slider-picker", | ||
"version": "1.0.46", | ||
"version": "1.0.47", | ||
"description": "Custom range slide picker for React Native.", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -27,2 +27,3 @@ /** | ||
* @param {Boolean} showSeparatorScale - Optional. Boolean value to determine whether or not to display lines dividing the slider into different sections. Defaults to `false`. If maxValue is greater than 10 or widtherPercentage is greater than or equal to 50, will be forced to false. | ||
* @param {Function} slideBeginCallback - Optional. Callback function to be executed when Slider's touch event begins. Called in `onPanResponderGrant` property of the component's `panResponder`. Defaults to `() => {}`. | ||
* @param {String} sliderInnerBackgroundColor - Optional. Sets background color of inner slider View. Can pass valid React Native color keywords, hexidecimal, rgb(), or rgba() values. Defaults to `"white"`. | ||
@@ -90,2 +91,3 @@ * @param {Object} sliderInnerBorderStyles - Optional. An object of StyleSheet properties to set border-related styles of sliderInner View component. If passed, the object is filtered to remove any key/value properties that aren't for component's border. Defaults to {}. | ||
this.maxValue = this.props.maxValue ? this.props.maxValue : 10; | ||
this.slideBeginCallback = this.props.slideBeginCallback ? this.props.slideBeginCallback : () => {}; | ||
@@ -228,2 +230,3 @@ // | ||
maxValue={this.maxValue} | ||
slideBeginCallback={() => this.slideBeginCallback()} | ||
/> | ||
@@ -230,0 +233,0 @@ </View> |
@@ -8,7 +8,8 @@ /** | ||
* @param {String} buttonBorderColor - Optional. Sets border color of Slider's button. Can pass valid React Native color keywords, hexidecimal, rgb(), or rgba() values. Defaults to `"dimgrey"`. | ||
* @param {Number} defaultValue - Optional. Default value the cursor will be placed in <StyledSliderPicker> on. | ||
* @param {Number} maxOffset - Optional. X-axis coordinates of right-edge of <StyledSliderPicker>. Component cannot be draggeed right past this point. | ||
* @param {Number} defaultValue - Optional. Default value the cursor will be placed in <StyledSliderPicker> on. | ||
* @param {Number} nonDraggablePressLocation - X-axis location of user press within <StyledSlidePicker>. Combined with triggerNonDraggablePress, determines whether or not handler function should be called for user presses within the parent component. | ||
* @param {Function} releaseCallback - Optional. Called when touch/gesture of component ends either by user releasing their finger, the panResponder event being terminated by the user's touch leaving the component, or when the user presses within the parent component. | ||
* @param {Function} slideBeginCallback - Optional. Callback function to be executed when Slider's touch event begins. Called in `onPanResponderGrant` property of the component's `panResponder`. Defaults to `() => {}`. | ||
* @param {Boolean} triggerNonDraggablePress - Combined with nonDraggablePressLocation, determines whether or not handler function should be called for user presses within the parent component. | ||
* @param {Number} nonDraggablePressLocation - X-axis location of user press within <StyledSlidePicker>. Combined with triggerNonDraggablePress, determines whether or not handler function should be called for user presses within the parent component. | ||
*/ | ||
@@ -40,2 +41,3 @@ | ||
this.releaseCallback = this.props.releaseCallback ? this.props.releaseCallback : () => {}; | ||
this.slideBeginCallback = this.props.slideBeginCallback ? this.props.slideBeginCallback : () => {}; | ||
@@ -149,2 +151,3 @@ // Check override style props | ||
panResponderGrantHandler = () => { | ||
this.props.slideBeginCallback(); | ||
// Set offset and value of state.drag to prevent Animated.View from returning to 0 coordinates | ||
@@ -151,0 +154,0 @@ // when it is moved again. |
54101
6
802