On Jul 6, 3:45 pm, Scott González <
scott.gonza...@gmail.com> wrote:
>
> I'm not sure why we're canceling the mouseup event. I do know that we
> cancel the click event because we're changing the event model. So, if you
> actually do drag an element, or sort an element, then when you mouse up, you
> didn't perform a click (you performed some other action). However, if you
> mouse down and mouse up on an element without moving (or you move but not
> long enough or far enough to cause some other action to occur), then the
> click event should be allowed because that is the actual action that
> occurred.
>
I agree. It might be better for the core to not cancel the events, but
if the plugins need to, they can do so. For example, let's say I am
building a zoom-plugin which is basically a transparent rectangle
floating above my HTML page and which zooms the content underneath it.
In this case, I might want the plugin to only zoom and not handle the
mouse events it is receiving and pass them on to the elements
underneath.
> I agree that we shouldn't be messing with the mouse* events. Hopefully
> someone else can chime in with why we're doing this. Paul Bakaus? Richard
> Worth?
>
> 2. What would the other small changes you mention be ?
>
> The other small changes would be to make sure we're not cancelling any other
> events that we shouldn't be cancelling (like mousedown). These changes
> aren't directly related to each other, but we should be consistent in how
> we're handling the events so I'd like to update all of the handlers at the
> same time.
I notice that the return value of "mouseDown" was changed from true to
false in 1.6 rc 2.5 but mouseUp's return value was left unchanged
(false) :
463 // preventDefault() is used to prevent the
selection of text here -
464 // however, in Safari, this causes select boxes
not to be selectable
465 // anymore, so this fix is needed
466 if(!$.browser.safari) event.preventDefault();
467 return true;
It might be best if the developer of this snippet could be involved in
this discussion as well ...
Best,
Vipul