Skip to content
This repository has been archived by the owner on Sep 5, 2024. It is now read-only.

update(slider): discrete sliders now support live dragging #331

Closed
wants to merge 2 commits into from

Conversation

ThomasBurleson
Copy link
Contributor

While dragging with a discrete slider, the thumb will immediately animate and slide regardless of the position in the slider bar. When released the thumb will animate and snap-to the closest discrete value.

@ThomasBurleson
Copy link
Contributor Author

Ready for review and merge

function onInput(ev) {
if (!isSliding && ev.eventType === Hammer.INPUT_START &&
!element[0].hasAttribute('disabled')) {

isSliding = true;
isDiscrete = angular.isDefined(attr.discrete);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

discrete isn't going to change (it's not a bindable value; it's a one-time), so we can just move this check to line 285.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch.

…ete values and snap-to animate to closest discrete value.
@marcysutton
Copy link
Contributor

This is slick! Still works great with the keyboard. 👍

@ThomasBurleson
Copy link
Contributor Author

😌 as I forgot about checking the keyboard support.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants