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

80
Vistas
HTML Input range type becomes un-usable by drag action if highlighted in chrome

Consider the following example as displayed on Windows in the Chrome browser.

<input type="range">

It produces a range slider. I have found that if I first use my mouse and

  1. Mouse down slightly below the range slider
  2. With mouse button still pressed move mouse across the range slider to top of it
  3. Release mouse

I can make the range slider stop functioning as expected. It displays a "circle with a line through it" cursor and refuses to allow me to slide the handle to the right or left.

My theory here is that the first actions I take "select" or "highlight" the range selector, as one would select a section of text in the browser, and then my subsequent attempts to operate the range slider are interpreted as me wanting to drag the selection.

Is there any work-around or way to avoid this bug?

So far attempts such as setting css user-select: none; on the input element do not work, neither does calling e.preventDefault() on the drag event.

See effect in GIF:

Recording of effect

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

After a little tinkering I was able to stop this behavior with the following JS:

document.querySelectorAll('input[type="range"]').forEach((input) => { 
    input.addEventListener('mousedown',  () => window.getSelection().removeAllRanges());
});
about 4 years ago · Juan Pablo Isaza 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