Skip to content

Conversation

@snowystinger
Copy link
Member

@snowystinger snowystinger commented Feb 4, 2026

Closes

Fixes the native outline focus that would appear after page load/refresh on RangeCalendar in Vanilla RAC.

Fixes home page, which was problematically rendering a div as a child of the html tag due to a Provider being placed between. The original body element had to be moved up to the provider and the associated styles as well. Problem could be seen by going to any S2 doc page, then clicking the home link in the top left.

Also fixed an AXE error we had for the validation help text in the range calendar example that didn't meet contrast in dark mode

✅ Pull Request Checklist:

  • Included link to corresponding React Spectrum GitHub Issue.
  • Added/updated unit tests and storybook for this change (for new code or code which already has tests).
  • Filled out test instructions.
  • Updated documentation (if it already exists for this component).
  • Looked at the Accessibility Practices for this feature - Aria Practices

📝 Test Instructions:

🧢 Your Project:

@rspbot
Copy link

rspbot commented Feb 4, 2026

forced-color-adjust: none;
transition: scale 200ms;
-webkit-tap-highlight-color: transparent;
outline: none;
Copy link
Member

Choose a reason for hiding this comment

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

Not seeing a focus ring on Calendar in the docs, but I am on RangeCalendar.

Copy link
Member

Choose a reason for hiding this comment

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

I think we either remove this (it overrides button-base's outline styles) or we keep this and add a data-focus-visible selector specifically in this css that is more specific similar to RangeCalendar.css

    &[data-focus-visible] {
      outline: none;
      z-index: 2;
      span {
        outline: 2px solid var(--focus-ring-color);
        outline-offset: 2px;
      }

Copy link
Member

Choose a reason for hiding this comment

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

remove it. I don't think Calendar had a problem, only RangeCalendar.

@rspbot
Copy link

rspbot commented Feb 4, 2026

@rspbot
Copy link

rspbot commented Feb 4, 2026

@reidbarber
Copy link
Member

Still seeing the same focus ring issue on Calendar

)}} />
</head>
<SettingsContextProvider>
<SettingsContextProvider elementType="body" style={{margin: '0px'}}>
Copy link
Member

Choose a reason for hiding this comment

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

Hmm so now there's a provider for the html element and the body? Why not just one?

Copy link
Member

@LFDanLu LFDanLu Feb 4, 2026

Choose a reason for hiding this comment

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

looks like 2nd provider was added for the color theme switcher? @reidbarber I suppose that was so it only affects the home page's example content only and not the entire page itself?

Copy link
Member

Choose a reason for hiding this comment

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

it's wrapped around the entire page though (this is the body element)

Copy link
Member

Choose a reason for hiding this comment

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

yeah, things seem to work just fine if I make the top most provider the SettingsProvider instead. @reidbarber lemme know if there were any issues you had ran into when working on the color switcher before

@LFDanLu
Copy link
Member

LFDanLu commented Feb 4, 2026

@reidbarber hm I don't see the focus ring issue, what repro steps/browser?

@reidbarber
Copy link
Member

@LFDanLu I'm not seeing a focus ring on the calendar cells here: https://d5iwopk28bdhl.cloudfront.net/pr/1e6f73dfbcd33cc6a569cf56aafa8480e7cc0087/Calendar

@LFDanLu
Copy link
Member

LFDanLu commented Feb 4, 2026

oh, I see the focus ring is completely gone instead gotcha

@rspbot
Copy link

rspbot commented Feb 4, 2026

@rspbot
Copy link

rspbot commented Feb 4, 2026

@rspbot
Copy link

rspbot commented Feb 4, 2026

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.

6 participants