Skip to content

Conversation

@deepktp
Copy link
Contributor

@deepktp deepktp commented Nov 19, 2025

Motivation

Slider Track alignment issues

Fixes #4002

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

  • Jest Unit Test
  • Checked with example app

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation using yarn docs-build-api
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

Additional context

@codecov
Copy link

codecov bot commented Nov 19, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.26%. Comparing base (fbaae85) to head (939ba43).
⚠️ Report is 4 commits behind head on next.

Additional details and impacted files
@@            Coverage Diff             @@
##             next    #4003      +/-   ##
==========================================
- Coverage   79.29%   79.26%   -0.03%     
==========================================
  Files          90       90              
  Lines        2144     2141       -3     
  Branches      960      922      -38     
==========================================
- Hits         1700     1697       -3     
  Misses        442      442              
  Partials        2        2              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@theianmay theianmay self-assigned this Nov 19, 2025
@theianmay theianmay added the component: Slider Issue related to Slider Component label Nov 19, 2025
@theianmay theianmay added this to the v5.0.0 milestone Nov 19, 2025
@github-project-automation github-project-automation bot moved this to In Progress 🚧 in Community Roadmap 🛣 Nov 19, 2025
@deepktp deepktp marked this pull request as ready for review November 24, 2025 06:22
@deepktp
Copy link
Contributor Author

deepktp commented Nov 24, 2025

looks good to me tested on expo 51 and 54
@theianmay

@theianmay
Copy link
Member

Tests are passing and I tested with example app and is behaving as expected. Details from my research below:

This fix addresses a layout regression in recent React Native versions (0.74+) caused by Yoga 3.0+ layout engine improvements. The original code used negative margins (TRACK_STYLE = -1) to offset the absolutely-positioned minimum track. This was a workaround that relied on specific layout calculation quirks in Yoga 2.x. While Yoga 3.0's major absolute positioning fixes were disabled by default for compatibility, other layout improvements changed how negative margins interact with absolute positioning, causing track misalignment. This fix handles the following:

  • Removes an obsolete workaround that no longer functions correctly
  • The track should align naturally through proper flexbox layout without manual margin offsets
  • Simplifies the code and aligns with modern layout behavior
  • Test snapshots confirm the negative margins are no longer needed

@theianmay theianmay merged commit 111bb73 into react-native-elements:next Nov 25, 2025
9 checks passed
@github-project-automation github-project-automation bot moved this from In Progress 🚧 to Closed or Merged 🏁 in Community Roadmap 🛣 Nov 25, 2025
github-actions bot pushed a commit that referenced this pull request Nov 25, 2025
fix: slider track alignment issue fix for new rn versions
github-actions bot pushed a commit that referenced this pull request Nov 25, 2025
fix: slider track alignment issue fix for new rn versions
@theianmay theianmay self-requested a review December 5, 2025 06:41
Copy link
Member

@theianmay theianmay left a comment

Choose a reason for hiding this comment

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

More detail review above. Merged and closed, thank you!

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

Labels

component: Slider Issue related to Slider Component

Projects

Status: Closed or Merged 🏁

Development

Successfully merging this pull request may close these issues.

Slider min and max tracks not aligned

2 participants