Skip to content

[slider] Thumb is lagging behind #44851

Closed

Description

@thany

Steps to reproduce

Steps:

  1. Drag the Slider component around fast enough

Current behavior

The knob lags behind the mouse cursor. In slow-motion it's clearly visible, but I think it's also noticable at normal speed, especially in person.

lag

Expected behavior

No lag, or try reducing the lag.

Context

No response

Your environment

I tested it just here: https://mui.com/material-ui/react-slider/
So whatever the environment is there, I guess. It says MUI 6.3.0 at the top, so that's probably what it is.

I'm using Firefox.

Search keywords: slider lag/lagging

Activity

  1. self-assigned this
    on Dec 24, 2024
  2. aarongarciah commented on Dec 24, 2024

    @aarongarciah
    Member

    Hey @thany, thanks for reporting. I'm only able to reproduce when applying a 20x CPU slowdown using browser devtools. Are you able to reproduce the issue in other browsers like Chrome? Do you have the devtools open when reproducing the issue?

  3. changed the title [-]Slider knob is lagging behind[/-] [+][Slider] Thumb is lagging behind[/+] on Dec 24, 2024
  4. thany commented on Dec 31, 2024

    @thany
    Author

    I can't test in Chrome right now (on my personal pc that doesn't have it) but I do remember I didn't have the devtools open.

    The 20x CPU slowdown does, however, prove the issue exists. It may seem silly, but your CPU might be tremendously fast. The next mum's tablet SoC might not be though 🤐

  5. mj12albert commented on Jan 6, 2025

    @mj12albert
    Member

    I kind of know of this issue, one thing that could help a bit is that the position of the thumb (as it is being dragged) is currently set using CSS left/bottom/right where the value (%) is derived from the slider value after it has already been rounded/clamped: https://github.com/mui/material-ui/blob/master/packages/mui-material/src/Slider/useSlider.ts#L697-L698

    It may be a bit smoother if those %s were unrounded. (Trying this in Base UI here mui/base-ui#1219)

    That said, I think this lag is impossible to eliminate completely? Even a native MacOS slider could lag a little bit (recording is slowed down 5x):

    output.mp4
  6. added
    ready to takeHelp wanted. Guidance available. There is a high chance the change will be accepted
    on Jan 6, 2025
  7. jgaik commented on Apr 30, 2025

    @jgaik

    Do i understand correctly that it should be wokred on - aka fix the rounding problem similarly to mui/base-ui change?

  8. changed the title [-][Slider] Thumb is lagging behind[/-] [+][slider] Thumb is lagging behind[/+] on May 6, 2025
  9. gauravxshukla commented on Aug 17, 2025

    @gauravxshukla

    Hey!
    I want to take up this issue.
    I feel I know the underlying issue and how to fix it.

  10. added a commit that references this issue on Aug 17, 2025
    c83a90d
  11. UmaMishra commented on Aug 27, 2025

    @UmaMishra

    Hi, I’d like to work on this issue.

  12. removed this from the Material UI with Base UI milestone on May 8, 2026
  13. shivenaggarwal commented on Oct 16, 2026

    @shivenaggarwal
    Contributor

    I'd like to pick this up. I looked into why the default slider still lags after the earlier attempts: the drag updates come from native pointermove/touchmove listeners, and React renders those after the browser has painted the frame, so the thumb is one frame behind on every slider, not only stepped ones. Flushing those updates synchronously removes that frame without changing values, rounding, or the click animation. I'll open a PR with tests and measurements shortly.

  14. github-actions commented on Oct 23, 2026

    @github-actions
    Contributor

    This issue has been closed. If you have a similar problem but not exactly the same, please open a new issue.
    Now, if you have additional information related to this issue or things that could help future readers, feel free to leave a comment.


    @thany Thanks again for creating this issue! If you have a moment, we would love to hear your thoughts on how we handled it with this short feedback form.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    performanceready to takeHelp wanted. Guidance available. There is a high chance the change will be acceptedscope: sliderChanges related to the slider.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions