Skip to content

Conversation

@vpai-2-eightfold
Copy link

@vpai-2-eightfold vpai-2-eightfold commented Jan 2, 2026

SUMMARY:

Fixes accessibility issue where slider thumbs (<input type="range"> elements) remained keyboard focusable even when the slider was in readOnly or disabled state. This prevented users from skipping non-interactive sliders during keyboard navigation.

GITHUB ISSUE (Open Source Contributors)

N/A

JIRA TASK (Eightfold Employees Only):

https://eightfoldai.atlassian.net/browse/ENG-164476

CHANGE TYPE:

  • Bugfix Pull Request
  • Feature Pull Request

TEST COVERAGE:

  • Tests for this change already exist
  • I have added unittests for this change

TEST PLAN:

Automated Tests
✅ Added 2 new unit tests in Slider.test.tsx:

  1. Test 1: Verifies tabIndex="-1" is set on thumb inputs when slider is readOnly or disabled
  2. Test 2: Verifies tabIndex attribute is not present on thumb inputs when slider is interactive

✅ All existing tests pass

Manual Testing

  1. Test readonly slider:

    • Create a slider with readOnly={true}
    • Press Tab key to navigate through the page
    • Expected: Slider thumbs are skipped in tab order
  2. Test disabled slider:

    • Create a slider with disabled={true}
    • Press Tab key to navigate through the page
    • Expected: Slider thumbs are skipped in tab order
  3. Test interactive slider:

    • Create a normal slider (no readonly/disabled props)
    • Press Tab key to navigate through the page
    • Expected: Slider thumbs receive focus and can be controlled with arrow keys
  4. Test range slider:

    • Create a range slider with readOnly={true}
    • Press Tab key to navigate
    • Expected: Both thumbs are skipped in tab order

- Add readOnly prop to SliderContext for state sharing
- Set tabIndex=-1 on markers when slider is readonly or disabled
- Fixes issue where slider markers remained tab-focusable in readonly mode

Resolves: ENG-164476
- Test markers have tabIndex=-1 when readonly
- Test markers have tabIndex=-1 when disabled
- Test markers remain focusable when interactive
@vpai-2-eightfold vpai-2-eightfold self-assigned this Jan 2, 2026
@codesandbox-ci
Copy link

codesandbox-ci bot commented Jan 2, 2026

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

@codecov
Copy link

codecov bot commented Jan 2, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.21%. Comparing base (1dc8501) to head (811ba3e).
⚠️ Report is 19 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1082      +/-   ##
==========================================
+ Coverage   84.09%   84.21%   +0.11%     
==========================================
  Files        1162     1146      -16     
  Lines       20976    21045      +69     
  Branches     7932     8000      +68     
==========================================
+ Hits        17639    17722      +83     
+ Misses       3249     3235      -14     
  Partials       88       88              

☔ 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.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant