Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

338
Views
Html range input active state: How can I make it work on mobile in Stencil?

I'm building a web component in Stencil. I've trimmed it down to the bare minimum to demonstrate my issue.

import { Component, h } from "@stencil/core";

@Component({
  tag: "custom-slider",
  styleUrl: "custom-slider.scss",
  shadow: true,
})
export class CustomSlider {
  render() {
    return (
      <input type="range" min="0" max="100" step="1" />
    );
  }
}
input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  margin-top: 100px;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  height: 36px;
  width: 36px;
  background: #555;
  margin-top: -12px;
}

input[type="range"]:active::-webkit-slider-thumb {
  background: blue;
}

input[type="range"]::-webkit-slider-runnable-track {
  width: 100%;
  height: 12px;
  background: #ccc;
}

input[type="range"]:active::-webkit-slider-runnable-track {
  background: #ddd;
}

When dragging the thumb I'm expecting it to be blue, but on mobile it isn't. Why?

It works fine on desktop, and the same code works in this CodePen https://codepen.io/tobbe_lundberg/pen/zYzWoKv for both desktop and mobile.

I'm testing using the device emulator on Chrome.

How can I make the active state work on mobile as well for my stenciljs web component?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!