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

122
Views
styling rc-slider track to contain handles within itself

By default, the handles in React rc-slider are translated by -50% and their style is that the handle overlaps the rail, enter image description here but I need the handles to be contained within the rail, after expanding the rail and shrinking the handles the style presents as below
enter image description here as you can see, the handles are outside the track and I need them to be contained within, I have tried to translate them by zero or by 0 for the left one and 100% for the right one, but this would cause them to overlap one another like soenter image description here if not that they overlap, this would be the behavior I am after enter image description here here are my styles

.rc-slider {
    position: relative;
    height: 16px;
    padding: 5px 0;
    width: 100%;
    border-radius: 6px;
    touch-action: none;
    box-sizing: border-box;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
    background-color: transparent;
    display: flex;
    align-items: center;
}
.rc-slider * {
    box-sizing: border-box;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}
.rc-slider-rail {
    position: absolute;
    width: 100%;
    background-color: #f9f8f8;
    height: 100%;
    border-radius: 6px;

}
.rc-slider-track {
    position: absolute;
    height: 100%;
    border-radius: 6px;
    background-color: #CDEA9F;
    opacity: 70%;
}
.rc-slider-handle {
    position: absolute;
    width: 24px;
    height: 12px;
    cursor: pointer;
    cursor: -webkit-grab;
    cursor: grab;
    border-radius: 40%;
    background-color: #8ECC29;
    touch-action: pan-x;
}

.rc-slider-handle-1 {
    transform: translateX(0) !important; <- this is wrong as can overlap

}
.rc-slider-handle-2 {
    transform: translateX(-100%) !important;<- this is wrong as can overlap

}

because the width is set dynamically I can not scale it or anything. I ran out of ideas so please help :)

Thanks a lot

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!