fix: add inline styles to sr-only spans for CSS-independent accessibility#6178
Closed
martijnrusschen wants to merge 1 commit intomainfrom
Closed
fix: add inline styles to sr-only spans for CSS-independent accessibility#6178martijnrusschen wants to merge 1 commit intomainfrom
martijnrusschen wants to merge 1 commit intomainfrom
Conversation
…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 Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
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-hiddenspan.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
yarn test src/test/calendar_test.test.tsx src/test/datepicker_test.test.tsx- all 474 tests passyarn lint- passesyarn type-check- passesFixes #6173
🤖 Generated with Claude Code