Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

121
Vistas
Prevent default drag in input type range in Vue

Is there any way to prevent the default drag feature of input range, with out impacting the click functionality? The user needs to change the values using clicking but not using drag.

<input   
  type="range"
  min="0"
  max="100"
  step="1"
  class="custom-audio-slider"
/>

demo : https://www.w3schools.com/code/tryit.asp?filename=GVF5ZH6S3HSF

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

Try like following snippet:

new Vue({
  el: '#demo',
  data() {
    return {
      value: 7,
      drag: false,
      move: false
    }
  },
  methods: {
    dragging() {
      this.drag = true
    },
    stopDragging() {
      this.drag = false
      this.move = false
    },
    moving() {
      if(this.drag) {
        this.move = true
      }
    },
  }
})

Vue.config.productionTip = false
Vue.config.devtools = false
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.5.17/vue.js"></script>
<div id="demo">
  <span id="valBox"></span>
  <div @mouseover="stopDragging">
    <input type="range" min="0" max="100" step="1" v-model="value" :disabled ="move"
     @mousemove="moving" @mousedown="dragging" @mouseup="stopDragging">
     <p>{{ value }}</p>
   </div>
</div>

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda