bootstrap-slider
bootstrap-slider copied to clipboard
Disable secondary click selection
Right clicking on the slider selects a value, I think this is a weird behaviour, only left clicking should.
Browsers treat right clicks as clicks. I don't think this actually causes any problems personally.
On Wed, Feb 22, 2017, 03:32 kpagcha [email protected] wrote:
Right clicking on the slider selects a value, I think this is a weird behaviour, only left clicking should.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/seiyria/bootstrap-slider/issues/712, or mute the thread https://github.com/notifications/unsubscribe-auth/AAum2Zn8ywKKloAy1TA25dJLBotL75hSks5rfACkgaJpZM4MIZsO .
@seiyria I am right clicking on other HTHL elements that respond to primary clicking and they don't do anything (buttons, links...), so I'm not so sure about that statement.
Yes, they do. If you read the mdn page on click events and look at the buttons, you'll see that if you don't filter the button out (right click is 2), then they're treated the same.
I don't understand. Check out this snippet I just made. Neither the jQuery event nor the pure JS event for the onclick event responds to a secondary click.
This is strange behavior. I think you should change the mousedown event listeners to click event listeners as it looks to be firing on any mouse click (left, right and middle mouse button as well). Making it change value only when clicking would be correct.
From the https://developer.mozilla.org/en-US/docs/Web/API/Element/click_event referenced above, it does say "An element receives a click event when a pointing device button (such as a mouse's primary mouse button) is both pressed and released while the pointer is located inside the element."
The right mouse and middle mouse button is not the primary mouse button (depending on personal settings of course).
@kpagcha , did you find a workaround to this? I thought perhaps I could override the event and prevent default (but can't find a way to do it).