yuanfux / react-native-hsv-color-picker

a react native HSV(hue, saturation, value) color picker
https://snack.expo.io/@fuyuanx/react-native-hsv-color-picker
48 stars 41 forks source link

onHuePickerDragMove #4

Closed Neha1405 closed 4 years ago

Neha1405 commented 4 years ago

onHuePickerDragMove method not working

yuanfux commented 4 years ago

Thanks for the issue. If you can provide me with more information about the error (i.e. code snippets that cause the error / screenshots), I might be able to help you out.

Neha1405 commented 4 years ago

Actully I want only the color slider with tap and drag feature. <HsvColorPicker ref={ref => { this.pickerColor = ref; }} huePickerHue={hue} onHuePickerDragMove={this.onHuePickerChange} onHuePickerPress={this.onHuePickerChange} satValPickerHue={hue} satValPickerSaturation={sat} satValPickerValue={val} satValPickerSize={0} satValPickerSliderSize={0} onSatValPickerDragMove={this.onSatValPickerChange} onSatValPickerPress={this.onSatValPickerChange} huePickerSliderSize={20} /> Screenshot_2020-01-17-15-23-39-965_com textcolorpickerdemo

On drag on the slider, the color should be changed and for that, I have used the onHuePickerDragMove method. But it's not dragging and changing the color. Only the onHuePickerPress method is working.

yuanfux commented 4 years ago

If you only want the slider, you can do

import HuePicker from 'react-native-hsv-color-picker/src/HuePicker'

check out this file for the supported props.

Neha1405 commented 4 years ago

Thanks for the help. But the slider(Dot) is not moving. <HuePicker hue={hue} onDragMove={this.onHuePickerChange} onDragStart={this.onHuePickerChange} sliderSize={15} onPress={this.onHuePickerChange} /> //Method onHuePickerChange({ hue }) { this.setState({ hue, }); }

yuanfux commented 4 years ago

What I would suggest is to print out the hue value in your method or try to change the hue value of the component manually to see if the slider is moving or not. If it is still not working, I'll take a look.

Neha1405 commented 4 years ago

@yuanfux See here is the video, you will better understand my issue. When I try to move the slider (Dot) it's not moving the position, but the color is changing. Screenrecorder-2020-01-17-17-56

yuanfux commented 4 years ago

I was on a vocation, sorry for the late replay. This is a confirmed bug related to this React Native issue https://github.com/facebook/react-native/issues/27003. This bug should be fixed in the lastest release. I really appreaciate for the issue. If you found more bugs please let me know. Have a good one.