On Mouse Up not being detected

Hey gang,

I swear I’ve asked this, or seen the solution, but I can’t find it now. Apologies for redundancy.

I have launched an animation on an element when you Mouse Down, and want it to reverse On Mouse Up, but there’s a bug I’m looking for the work-around on:

There were some google suggestions of promoting blocking elements with animated z-index, but that didn’t detect the Mouse Up either. I have the feeling I’m going be coding to get around it.

mouseUp.hype.zip (19.7 KB)

Thank you in advance!

Well, it does exactly what you want it to do: circle grows on mouseDown and shrinks on mouseUp… :thinking: Tested in Chrome, Firefox and Safari.

Interesting. Sounds like I should call Apple! Certainly not doing that here (Safari , Chrome, Firefox all failing, Mojave)

This will likely stick if the mouse drags slightly when clicking down.
I think if that happen mouse events will bubble through drag gesture event rather than a mouse events.

You probably could add an action on the on drag to run code to take care of that using drag end event

	if (event['hypeGesturePhase'] == hypeDocument.kHypeGesturePhaseEnd ){
	hypeDocument.continueTimelineNamed('anim', hypeDocument.kDirectionReverse, false)
	}
1 Like

Ok, I can reproduce the effect on an older machine (Macbook Air 2011). In fact, it occurs when I have the mousUp while still dragging …

We consider it a bug that a drag cancels the mouse up action. @MarkHunte’s solution is a good workaround.

1 Like

@MarkHunte indeed found the solution, perfect.

For those who are not yet plugged in to the Javascript coding yet:

  1. On the Drag_me element (from my attached file) go to On Drag, and enter a New Javascript Function
  2. Paste in Mark’s code
  3. Probably rename the function inside the Code area

snap

Thank you again!

2 Likes