Skip to content

Make slider thumbs not overshoot the track#12549

Merged
sfc-gh-tteixeira merged 19 commits intodevelopfrom
slider-fixes
Sep 18, 2025
Merged

Make slider thumbs not overshoot the track#12549
sfc-gh-tteixeira merged 19 commits intodevelopfrom
slider-fixes

Conversation

@sfc-gh-tteixeira
Copy link
Copy Markdown
Contributor

@sfc-gh-tteixeira sfc-gh-tteixeira commented Sep 17, 2025

Describe your changes

Make slider thumbs not overshoot the track. (I found a really nice way of doing this!)

Also: this improves the animation for showing the min/max labels, and makes them show on focus-visible as well for better a11y.

GitHub Issue Link (if applicable)

Closes #4284

Testing Plan

  • Explanation of why no additional tests are needed
  • Unit Tests (JS and/or Python) -- This code path is well-tested. Just updated existing tests.
  • E2E Tests -- This code path is already well-tested. No additional tests implemented.
  • Any manual testing needed?

Contribution License Agreement

By submitting this pull request you agree that all contributions to this project are made under the Apache 2.0 license.

@snyk-io
Copy link
Copy Markdown
Contributor

snyk-io bot commented Sep 17, 2025

🎉 Snyk checks have passed. No issues have been found so far.

security/snyk check is complete. No issues have been found. (View Details)

license/snyk check is complete. No issues have been found. (View Details)

@sfc-gh-tteixeira sfc-gh-tteixeira changed the title Make slider thumbs not overshoot the track, and show min/max on hover Make slider thumbs not overshoot the track Sep 17, 2025
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Sep 17, 2025

✅ PR preview is ready!

Name Link
📦 Wheel file https://core-previews.s3-us-west-2.amazonaws.com/pr-12549/streamlit-1.49.1-py3-none-any.whl
🕹️ Preview app pr-12549.streamlit.app (☁️ Deploy here if not accessible)

@sfc-gh-tteixeira sfc-gh-tteixeira marked this pull request as ready for review September 17, 2025 19:27
@sfc-gh-tteixeira sfc-gh-tteixeira enabled auto-merge (squash) September 17, 2025 21:03
@lukasmasuch lukasmasuch requested a review from Copilot September 18, 2025 07:33
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes slider thumbs overshooting their track boundaries by implementing a new DOM structure where thumbs are positioned within a wrapper container that has proper horizontal padding, while the track itself remains unpadded.

Key changes:

  • Introduces a custom renderInnerTrack function to restructure the slider's DOM hierarchy
  • Adds new styled components (StyledInnerTrackWrapper and StyledThumbWrapper) to control thumb positioning
  • Updates transition timing for slider tick bar visibility

Reviewed Changes

Copilot reviewed 3 out of 117 changed files in this pull request and generated 2 comments.

File Description
frontend/lib/src/components/widgets/Slider/styled-components.ts Adds new styled components for track wrapper and thumb positioning, updates tick bar transition
frontend/lib/src/components/widgets/Slider/Slider.tsx Implements custom inner track rendering logic and restructures slider DOM hierarchy
e2e_playwright/st_slider.py Updates test values to reflect corrected slider behavior

Copy link
Copy Markdown
Collaborator

@lukasmasuch lukasmasuch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍 just needs a e2e snapshot update

@lukasmasuch lukasmasuch added security-assessment-completed change:bugfix PR contains bug fix implementation impact:users PR changes affect end users labels Sep 18, 2025
@sfc-gh-tteixeira sfc-gh-tteixeira merged commit a9f7019 into develop Sep 18, 2025
39 of 40 checks passed
@sfc-gh-tteixeira sfc-gh-tteixeira deleted the slider-fixes branch September 18, 2025 13:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

change:bugfix PR contains bug fix implementation impact:users PR changes affect end users

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix alignment of slider knob

3 participants