Commit 735ef1ac authored by Leopoldthecoder's avatar Leopoldthecoder Committed by 杨奕

Slider: reset size on click / drag

parent 4ebb9983
...@@ -138,6 +138,7 @@ ...@@ -138,6 +138,7 @@
onDragging(event) { onDragging(event) {
if (this.dragging) { if (this.dragging) {
this.displayTooltip(); this.displayTooltip();
this.$parent.resetSize();
let diff = 0; let diff = 0;
if (this.vertical) { if (this.vertical) {
this.currentY = event.clientY; this.currentY = event.clientY;
......
...@@ -221,6 +221,7 @@ ...@@ -221,6 +221,7 @@
onSliderClick(event) { onSliderClick(event) {
if (this.disabled || this.dragging) return; if (this.disabled || this.dragging) return;
this.resetSize();
if (this.vertical) { if (this.vertical) {
const sliderOffsetBottom = this.$refs.slider.getBoundingClientRect().bottom; const sliderOffsetBottom = this.$refs.slider.getBoundingClientRect().bottom;
this.setPosition((sliderOffsetBottom - event.clientY) / this.sliderSize * 100); this.setPosition((sliderOffsetBottom - event.clientY) / this.sliderSize * 100);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment