Middle click mouse scrolling behavior is 'wrong'


(Matches) #1
  1. Open a topic
  2. Middle mouse click to get the up/down/left/right scrolliness
  3. Use mouse 4 to go back
  4. Mouse is still scrolliness

That’s different. (Required: Mousewheel, mouse4 button associated with browser ‘back’)


(lid) #3

Discourse is a one page show. There is no " real" page navigation. When you go back(mouse 4), The page dynamically change what need to be change without loading a new page.

This is why the scrolling, a native browser feature, is not finished by the browser on “page” change.
The browser can not detect a page navigation because there isn’t one.


(Matches) #5

Yeah, but all other navigation features are hijacked, this one should be to if you’re going for the full monty.


(Sam Saffron) #6

I don’t think we can even disable this … afaik no hooks for it.


(lid) #7

not even an alert will disable it


(Matches) #8

On browser back navigation cancel middle mouse event by issuing mouse up?

This might require a boolean field for middle mouse down.


(Jeff Atwood) #9

Middle click mouse scrolling is “wrong”, IMHO. I think it’s also very Windows specific.

Autoscrolling (middle click and hold) is a crazy weird artifact of … something.

@geek you may remember this blast from the past.

Apparently, it is an artifact of three button mice without a scroll wheel. Think of it as the mouse’s floppy drive.


(Matches) #10

Every os has a middle mouse click, scroll feature. You don’t hold the button down, it’s a toggle.

Just because you don’t use it makes it a foreign concept for 80 percent of the people who use the browser from a desktop.

Tell me, how does one copy the share link button to clipboard from mobile? What’s your workflow.


(Lowell Heddings) #11

I wish there was a way to highlight a single sentence in a post and click the Like button for it.


(Sam Saffron) #12

Regardless, this is a browser bug with very little we can do, either pushState should be clearing “scrolliness” or there needs to be a JavaScript API to untoggle it.

Anyway if you find a simple JS api that can clear it I would be happy to add it into our transition code.


(Matches) #13

I’ll take a look when I’m on desktop. Can you test sending escape key?


(lid) #14

replaceState will mess the scrolling up when posts id are changing. like it mess the native browser search.
but it doesn’t so nothing to worry about at this point


(Matches) #15

Not sure what your sentence means, since scrolling doesn’t cancel between page boundaries, but search cancels on page boundaries.


(lid) #16

I am referring to a different issue with the native browser search, due to replaceState functionality.
the function is a basically a virtual change of the page, by just changing the url and history. without loading a page.

It is just browser inconsistency. having replaceState disable the auto scrolling will render the scrolling useless because it is used while scrolling a topic without, without “changing” a page.


(Matches) #17

I might be dense, but I still don’t understand the point you’re attempting to make.


(lid) #18

There are incosistancy in the browser behavior while using replaceState functionality.

buttom line is if replacestate would of cancel the auto scrolling, then discourse will actually break the scrolling in topics ( in that mode).
if you watch the address bar in your browser while scrolling down a topic you will notice the url change ( this is due to replacestate).

for this function to work, browser developers will have to expose an api the allow the programmer to control the behviour of replacestate, for feature like ( native search box, auto scrolling , etc)


(Matches) #19

The goal is catching the ‘back’ event, not the replacestate event. They are already hijacking this feature.

I also disable the auto url change feature. It’s annoying.


(lid) #20

The goal is actually exiting the auto scroll, if you find a way to do this in javascript please share it with us.
it is not a problem to detect the back event.


(Sam Saffron) #21

That is trivial … the goal is to find an API in JS that allows you to turn of scrolliness. Test is out from console with a setTimeout or setInterval


(Matches) #22

Google fu says:

$(“p”).mousedown(function(b){
if(b.which==1)alert(‘Left Mouse Button Clicked’);
else if(b.which==2)alert(‘Middle Mouse Button Clicked’);
else if(b.which==3)alert(‘Right Mouse Button Clicked’);
});