Skip to content

Commit eae06ee

Browse files
committed
refactor(RangeSlider): exclude right mouse buttons from mousedown events
1 parent e478d98 commit eae06ee

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

js/src/range-slider.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ class RangeSlider extends BaseComponent {
136136
})
137137

138138
EventHandler.on(this._element, EVENT_MOUSEDOWN, SELECTOR_RANGE_SLIDER_LABEL, event => {
139-
if (!this._config.clickableLabels) {
139+
if (!this._config.clickableLabels || event.button !== 0) {
140140
return
141141
}
142142

@@ -145,6 +145,10 @@ class RangeSlider extends BaseComponent {
145145
})
146146

147147
EventHandler.on(this._element, EVENT_MOUSEDOWN, SELECTOR_RANGE_SLIDER_INPUTS_CONTAINER, event => {
148+
if (event.button !== 0) {
149+
return
150+
}
151+
148152
this._isDragging = true
149153
const clickValue = this._calculateClickValue(event)
150154
this._dragIndex = this._getNearestValueIndex(clickValue)

0 commit comments

Comments
 (0)