Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

343
Visualizações
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
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda