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

Allow user to set the progress of slider #37

Closed
patrickelectric opened this issue Mar 13, 2024 · 5 comments · Fixed by #38
Closed

Allow user to set the progress of slider #37

patrickelectric opened this issue Mar 13, 2024 · 5 comments · Fixed by #38

Comments

@patrickelectric
Copy link

Programatically we want to simulate the slide-unlock event from a physical joystick, right now it's not possible to access the percentage from our part, only internally using a mouse or a touchscreen.

@j2only
Copy link
Owner

j2only commented Mar 17, 2024

@patrickelectric Please, check 0.5.4 version. I've added a new prop "position" where you can pass the progress percentage (from 0 to 100) of the slider.

@patrickelectric
Copy link
Author

@j2only it appears that completed it not being emitted once position gets to 100%, is that expected ?

@j2only
Copy link
Owner

j2only commented Mar 19, 2024

it appears that completed it not being emitted once position gets to 100%, is that expected ?

No, completion should be emitted as soon as the position reaches 100%. Check it out in demo https://j2only.github.io/vue-slide-unlock.

@JoaoMario109
Copy link
Contributor

JoaoMario109 commented Mar 19, 2024

I've noticed that the @completed event does not seem to be emitted when emulateSlideFromProps is utilized. I think that the following modification could address this issue.

https://github.com/j2only/vue-slide-unlock/blob/b22c518eeea0d9feaf8894112ff4cbffc9eb324a/lib/SlideUnlock.vue#L228

Maybe change to the following

if (computedPosition >= sliderWidth.value - props.height) {
    complete();
    passVerify();
}

@j2only
Copy link
Owner

j2only commented Mar 21, 2024

@JoaoMario109 Thank you for your pull request. I added changes to version 0.5.5.

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 a pull request may close this issue.

3 participants