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

Disable wheel event #54

Closed
benben994 opened this issue Jan 3, 2020 · 5 comments
Closed

Disable wheel event #54

benben994 opened this issue Jan 3, 2020 · 5 comments
Assignees
Labels
enhancement New feature or request

Comments

@benben994
Copy link

Hi I'm wondering is there any way that I can disable only wheel event for zooming?
I saw the onChange$ subscribe all resize, rotate event.
But I only need to prevent user to use mouse wheel.
Thanks.

@benben994 benben994 added the enhancement New feature or request label Jan 3, 2020
@timtnleeProject
Copy link
Owner

Hi @benben994 ,
I'm afraid not, zooming by wheel is the natural feature of clipper-fixed, and should not be disabled.
You can use clipper-basic instead.

@UnderTheMoonspell
Copy link

UnderTheMoonspell commented Sep 9, 2020

This option would be really nice. I need all the features of clipper-fixed but I just want to prevent zooming with the mouse wheel, I tried to capture the wheel event and use preventDefault but it doesnt work. At least it would be nice that the wheel event would emit an event that could be capture in the parent so we could update the range accordingly.

My problem is that I use a slider to control the zoom, but i cannot sync it with the mouse wheel nor disable the mouse wheel which would prevent the problem

@timtnleeProject
Copy link
Owner

timtnleeProject commented Sep 10, 2020

New feature in the next version

Add a prop handleZoomEvent to intercept both mouse and touch zooming events.

Example:

<clipper-fixed :handle-zoom-event={handleZoomEvent}/>
// method
handleZoomEvent: function (scale) {
  // fires when bgWH$ is about to change
  // normal behavior
  return scale;
  // disable zoom
  return NaN;
}

@timtnleeProject timtnleeProject pinned this issue Sep 10, 2020
@UnderTheMoonspell
Copy link

@timtnleeProject thank you so much. Awesome plugin!

@timtnleeProject
Copy link
Owner

v3.0.3 released

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants