Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Corrected Slider Behavior #43

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Conversation

dmacpro91
Copy link

On mobile there was a bug where I couldn't select the edge values of the slider (0.0, 1.0). It would allow me to get very close, but I could never slide to #000000 or #ffffff.

The slider's thumb also would position itself to the right of the touch rather than centering on it.

I corrected both of those issues.

Fixed bug with not being able to obtain edge values of slider (0.0, 1.0) on mobile.

Corrected slider thumb touch position to center itself to the touch rather than to the right of the touch.

This should fix the bugs mentioned in most cases, but if the view is nested in more containers we may need to obtain the padding/margin offsets for the container view. I'll address that if there's enough demand.
Fixed bug with not being able to obtain edge values of slider (0.0, 1.0) on mobile.

Corrected slider thumb touch position to center itself to the touch rather than to the right of the touch.

This should fix the bugs mentioned in most cases, but if the view is nested in more containers we may need to obtain the padding/margin offsets for the container view. I'll address that if there's enough demand.
Made slider more user-friendly on mobile by continuing to read the touch events even when the touch is moved slightly (sliderHitSlop points) out of the bounds of the slider's box once started.

outOfSlider is now unnecessary due to slider bounds being handled in sliderThumbAdjuster.

There is a bug in the implementation of locationX on Android so using pageX (with appropriate padding/margin offset calculations) is more reliable.

Still may need more padding/margin calculations for specific use-cases, but very usable currently.
Corrected default value for sliderHitSlop.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant