Consider the following example as displayed on Windows in the Chrome browser.
<input type="range">
Select the range slider using one of the following methods:
- Method #1: Click inside the code snippet to activate the iframe. Press CTRLA to select the entire iframe content. Try moving the slider with the mouse.
- Method #2: Above the slider, hold down the left mouse button and select the page content down to the bottom of the slider. Release the mouse button. Try moving the slider with the mouse.
- Method #3: Click inside the code snippet to activate the iframe. Triple-click on the empty area next to the range slider. Try moving the slider with the mouse.
So, with this methods 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[type=range] element do not work:
input[type="range"] {
user-select: none;
}
<input type="range">
neither does calling e.preventDefault() on the drag event:
document.querySelector('input[type="range"]').addEventListener('drag', (e) => {
e.preventDefault();
});
<input type="range">
See effect in GIF:



user-select: noneon the pseudo-elements as well, but interestingly, the bug can still be reproduced with method #1 and method #2. It's a pity the question hasn't received much attention over the years; it's not a common case, but it's certainly interesting. I believe we should primarily look for CSS-based solutions to avoid unnecessary JS execution.