Vue-slider-component: dot not draggable

Created on 19 Nov 2018  路  2Comments  路  Source: NightCatSama/vue-slider-component

hi,
i took the first example from the documentation for use in vue 2.x
i set the value to 5
when it loads the tooltip says 5 but when i'm trying to drag the dot it's not moving from the zero position and in the tooltip i can read "100".
my code is exactly the same as in the documentation. and no error in console.

thank you for your help! i need this for work.

slideissue

Most helpful comment

In my project, some sliders are draggable, some are not.
The ones that are not draggable, i give a ref and a drag start event, like this:

<vue-slider
  v-model="verkoopKans"
  ref="slider"
  :interval="5"
  :min="0" :max="100"
  width="100%"
  @drag-start="updateSlider()"
></vue-slider>

And then I define the method updateSlider() like this:

updateSlider: function() {
  this.$refs.slider.refresh();
},

I really wish I knew why some sliders just work, and some are not draggable and need this 'hack', but for now, I don't have a clue. Maybe sliders visible on page load just work, and sliders somewhere inside a v-if don't but I'm not sure.

All 2 comments

How did you solve this issue?? @MrQuery

In my project, some sliders are draggable, some are not.
The ones that are not draggable, i give a ref and a drag start event, like this:

<vue-slider
  v-model="verkoopKans"
  ref="slider"
  :interval="5"
  :min="0" :max="100"
  width="100%"
  @drag-start="updateSlider()"
></vue-slider>

And then I define the method updateSlider() like this:

updateSlider: function() {
  this.$refs.slider.refresh();
},

I really wish I knew why some sliders just work, and some are not draggable and need this 'hack', but for now, I don't have a clue. Maybe sliders visible on page load just work, and sliders somewhere inside a v-if don't but I'm not sure.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

yusupprog picture yusupprog  路  5Comments

creativejeff picture creativejeff  路  7Comments

Shimabuk picture Shimabuk  路  5Comments

alexpvieira picture alexpvieira  路  4Comments

michaelpelletier picture michaelpelletier  路  8Comments