Code Monkey home page Code Monkey logo

Comments (8)

NavidZ avatar NavidZ commented on July 18, 2024

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

from auxclick.

bokand avatar bokand commented on July 18, 2024

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.

from auxclick.

lpd-au avatar lpd-au commented on July 18, 2024

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/)

from auxclick.

NavidZ avatar NavidZ commented on July 18, 2024

@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)?

from auxclick.

bokand avatar bokand commented on July 18, 2024

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.

from auxclick.

NavidZ avatar NavidZ commented on July 18, 2024

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?

from auxclick.

lpd-au avatar lpd-au commented on July 18, 2024

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.

from auxclick.

NavidZ avatar NavidZ commented on July 18, 2024

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.

from auxclick.

Related Issues (10)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.