Skip to content
This repository has been archived by the owner on Jun 25, 2019. It is now read-only.

Should preventDefault override middle click autoscroll? #17

Closed
lpd-au opened this issue Mar 27, 2017 · 8 comments
Closed

Should preventDefault override middle click autoscroll? #17

lpd-au opened this issue Mar 27, 2017 · 8 comments

Comments

@lpd-au
Copy link

lpd-au commented Mar 27, 2017

The issues surrounding right click context menu are quite unintuitive and unfortunate, but in a similar vein, is MMB autoscroll intended to be a preventable behaviour of auxclick? Currently Firefox for Windows sends an auxclick event and opens the autoscroll menu, while Chrome for Windows doesn't fire an auxclick event and instead opens the autoscroll menu. Would this be worthy of a note in the spec?

@NavidZ
Copy link
Member

NavidZ commented Mar 27, 2017

This does sound reasonable to me. What do you think @bokand?

@bokand
Copy link

bokand commented Mar 27, 2017

Is there any reason not to match Firefox? IMO, it makes sense for preventDefault to prevent autoscroll. Also note on Linux MMB generally shortcuts to paste. I would expect preventDefault to prevent that behavior too.

@lpd-au
Copy link
Author

lpd-au commented Mar 27, 2017

Just to clarify, in my testing Firefox Nightly behaved the same whether preventDefault was called or not, either way an auxclick event was fired but the autoscroll menu also appeared. (https://jsfiddle.net/nk7qgsm5/1/)

@NavidZ
Copy link
Member

NavidZ commented Mar 27, 2017

@bokand is there anywhere that we have specified the autoscroll? Or should we start specifying it here as the default behavior of auxclick when there is a scroller under the target (I'm not quite familiar with the autoscroll so ignore this "when" if it is not true)?

@bokand
Copy link

bokand commented Mar 27, 2017

AFAIK autoscroll isn't specified - it'a s Windows platform feature. As such, I'm not sure we should specify it as anything other than "platform default action". i.e. we shouldn't treat it any differently than the Linux paste-on-middle-click behavior, or any other MMB platform behavior.

@NavidZ
Copy link
Member

NavidZ commented Mar 27, 2017

I was looking more into the behavior of autoscroll and realized that on Windows both on Chrome and FF the auto scroll icon shows up after mousedown not the click. So similar to the context menu this is not something that preventDefault on auxclick could control. @lpd-au WDYT?

@lpd-au
Copy link
Author

lpd-au commented Mar 28, 2017

Ah ok, silly me. So the correct thing to do is to preventDefault on pointerdown as well? Fortunately that seems to work even for chorded button presses (https://jsfiddle.net/yygp3qfa/2/). If Linux MMB paste also activates on pointerdown like contextmenu does then that would be handy for giving general platform-agnostic advice. Now I know to look for it, it does appear that the UI Events spec has a note on default actions of mousedown, even going so far as describing "a mouse-driven panning feature that is activated when the middle mouse button is pressed". All that considered, a second note for pointerdown beneath the one for contextmenu would be worthwhile in my opinion, but I'm no spec expert if you feel it's better left to the domain of MDN et al.

@NavidZ
Copy link
Member

NavidZ commented Mar 28, 2017

So maybe you want to mention it (or just create an issue) in the pointer event spec for the pointerdown one and I will follow up that issue in the pointer event working group.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants