Skip to content

fix: add inline styles to sr-only spans for CSS-independent accessibility#6178

Closed
martijnrusschen wants to merge 1 commit intomainfrom
fix/sr-only-inline-styles
Closed

fix: add inline styles to sr-only spans for CSS-independent accessibility#6178
martijnrusschen wants to merge 1 commit intomainfrom
fix/sr-only-inline-styles

Conversation

@martijnrusschen
Copy link
Copy Markdown
Member

Summary

  • Adds inline styles to sr-only spans in the calendar header so they work without requiring the datepicker stylesheet
  • Fixes an issue where weekday names show full names (e.g., "Thursday") instead of abbreviated names when CSS isn't properly applied

Problem

In v9.0.0, sr-only spans were added for accessibility (commit 81e9c6f). These spans contain full weekday names for screen readers, while the visible abbreviated names are in a separate aria-hidden span.

When CSS isn't loaded or applied correctly (which can happen in certain environments like Tauri), the sr-only class doesn't hide the full weekday name, causing visual issues.

Solution

Add inline styles directly to the sr-only spans, ensuring they work regardless of whether the stylesheet is loaded. This maintains the accessibility pattern while being more resilient to CSS loading issues.

Test plan

  • Run yarn test src/test/calendar_test.test.tsx src/test/datepicker_test.test.tsx - all 474 tests pass
  • Run yarn lint - passes
  • Run yarn type-check - passes

Fixes #6173

🤖 Generated with Claude Code

…lity

The sr-only spans now work without requiring the datepicker stylesheet
to be loaded. This fixes an issue where weekday names would show full
names (e.g., "Thursday") instead of abbreviated names when CSS isn't
properly applied - which can happen in certain environments like Tauri.

The accessibility pattern remains the same (screen readers get the full
weekday name, visual users see the abbreviation), but now it works
even when CSS fails to load.

Fixes #6173

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@codecov
Copy link
Copy Markdown

codecov Bot commented Dec 18, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.31%. Comparing base (0231bbd) to head (81c496c).
⚠️ Report is 6 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6178   +/-   ##
=======================================
  Coverage   99.31%   99.31%           
=======================================
  Files          30       30           
  Lines        3801     3802    +1     
  Branches     1652     1635   -17     
=======================================
+ Hits         3775     3776    +1     
  Misses         25       25           
  Partials        1        1           

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

formatWeekDay not working on v8 or v9 (in Tauri)

1 participant