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

136
Views
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 answers
Answer question

0

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

about 4 years ago · Juan Pablo Isaza Report

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 Report
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!