Commit f2be585e5ee594f9e76ba711929ff63f75b5ef48
1 parent
73772536
optimize Slider when dragging can select content in page
optimize Slider when dragging can select content in page
Showing
2 changed files
with
4 additions
and
0 deletions
Show diff stats
src/components/slider/slider.vue
... | ... | @@ -253,6 +253,7 @@ |
253 | 253 | // for single use |
254 | 254 | onSingleButtonDown (event) { |
255 | 255 | if (this.disabled) return; |
256 | + event.preventDefault(); | |
256 | 257 | this.onSingleDragStart(event); |
257 | 258 | window.addEventListener('mousemove', this.onSingleDragging); |
258 | 259 | window.addEventListener('mouseup', this.onSingleDragEnd); |
... | ... | @@ -306,6 +307,7 @@ |
306 | 307 | // for range use first |
307 | 308 | onFirstButtonDown (event) { |
308 | 309 | if (this.disabled) return; |
310 | + event.preventDefault(); | |
309 | 311 | this.onFirstDragStart(event); |
310 | 312 | window.addEventListener('mousemove', this.onFirstDragging); |
311 | 313 | window.addEventListener('mouseup', this.onFirstDragEnd); |
... | ... | @@ -354,6 +356,7 @@ |
354 | 356 | // for range use second |
355 | 357 | onSecondButtonDown (event) { |
356 | 358 | if (this.disabled) return; |
359 | + event.preventDefault(); | |
357 | 360 | this.onSecondDragStart(event); |
358 | 361 | window.addEventListener('mousemove', this.onSecondDragging); |
359 | 362 | window.addEventListener('mouseup', this.onSecondDragEnd); | ... | ... |
test/routers/slider.vue