How do I stop drag events on overlays from being captured by the viewer?
For an app I'm building, I'm using Seadragon AJAX to manage icon images (as Overlays), and I'd like the user to be able to drag them around relative to the base image.
I'm creating MouseTracker instances pointed at the individual icons'
elements, and those MoseTrackers seem to be getting press, drag, and release events from the mouse when you click and drag them.
The trouble is that dragging the mouse from an icon also triggers the viewer's default drag handler, and causes the base image to scroll along with the drag. So the net effect is that the base image scrolls, and the icon you're trying to drag remains stationary relative to the image space.
Is there any way to prevent the viewer from capturing drag events targeted at overlaid elements, or else override the default drag handler to not respond to such events?
I'm creating MouseTracker instances pointed at the individual icons'
The trouble is that dragging the mouse from an icon also triggers the viewer's default drag handler, and causes the base image to scroll along with the drag. So the net effect is that the base image scrolls, and the icon you're trying to drag remains stationary relative to the image space.
Is there any way to prevent the viewer from capturing drag events targeted at overlaid elements, or else override the default drag handler to not respond to such events?
1
person has this question
I have this question, too!
Tell me when someone answers.
The more people who ask this question, the more it gets noticed.
The more people who ask this question, the more it gets noticed.
The company marked this question as answered.
-
Inappropriate?Hey Ted,
Very sorry for not replying sooner! It's a busy time around here.
You've uncovered a limitation in MouseTracker that we never ran into. Yikes. Thanks for pointing it out. We'll take a look at how we should fix this.
I can think of one workaround: when the user begins to drag one of your overlays, disable mouse navigation on the viewer, and re-enable it when the user ends the drag.
To do this, add a pressHandler that simply calls viewer.setMouseNavEnabled(false), and a releaseHandler that -- only when insideElmtPress is true -- calls the same method with true instead.
Is that an acceptable workaround for you?
I’m thankful for your feedback!
The company says
this answers the question
Loading Profile...



EMPLOYEE