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

130
Visualizações
HTML input type='range' not moving

I have an Options component containing a slider input. I don't understand why the thumb of the slider doesn't move if I set the "value" parameter, but i need it.

Here the code:

const Options: React.FC<Props> = () => {

    return (
        <div className='options'>
            <span className='boh'>CUSTOMIZE YOUR PASSWORD</span>
            <div className='slider-container'>
                <input type="range" id="slider" min="1" max="100" value='10' />
                <label htmlFor="slider">Length</label>
            </div>
        </div>
    )
}

export default Options

I thank anyone who gives me a hand

about 4 years ago · Juan Pablo Isaza
2 Respostas
Responde à pergunta

0

I solved it by replacing the "value" parameter with "defaultValue"

about 4 years ago · Juan Pablo Isaza Relatório

0

You set this up in such a way that your value will always be 10. If you want to be able to change that, you'll need to set the state in react to the initial value of 10, and also add the logic to be able to mutate that value. Here's one way to do this:

import { useState } from 'react'

const [value, changeValue] = useState(10)

return (
<input value={value} onChange={e => changeValue(e.target.value)} />
)
about 4 years ago · Juan Pablo Isaza Relatório
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