Skip to content

fix: show calendar header in s2 dialog #8621

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jul 24, 2025
Merged

Conversation

yihuiliao
Copy link
Member

Closes

✅ 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 Jul 23, 2025

@rspbot
Copy link

rspbot commented Jul 23, 2025

@rspbot
Copy link

rspbot commented Jul 23, 2025

<CalendarHeading />
<CalendarButton slot="next"><ChevronRightIcon /></CalendarButton>
</Header>
<Provider
Copy link
Member

Choose a reason for hiding this comment

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

we already clear some context in

[OverlayTriggerStateContext, null]

should we clear these there as well? then we don't need to do it in two files

Copy link
Member

Choose a reason for hiding this comment

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

might be worth to do it at the calendar level too in case someone is using it standalone though right?

Copy link
Member Author

Choose a reason for hiding this comment

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

but if a person were to just use a Calendar inside a dialog rather than a DatePicker, then wouldn't this still be an issue?

Copy link
Member

Choose a reason for hiding this comment

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

I guess maybe? it might pick up some stray context, but same argument could be made for the overlay trigger state context

Copy link
Member Author

Choose a reason for hiding this comment

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

im fine adding it to CalendarPopover in DatePicker, but i think we'll still need to clear the context in Calendar and RangeCalendar for any standalone cases

Copy link
Member

Choose a reason for hiding this comment

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

they'd have the same issue with the overlaytriggerstatecontext too, so that should probably be moved to the same place

Copy link
Member

@LFDanLu LFDanLu left a comment

Choose a reason for hiding this comment

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

verified locally that rangecalendar and calendar render just fine in a s2 dialog, will approve after we decide if we wanna clear it at the datepicker level too

@snowystinger
Copy link
Member

we can followup with any small changes later, but merging so we can patch something that works

@snowystinger snowystinger added this pull request to the merge queue Jul 24, 2025
Merged via the queue into main with commit 1e8c02e Jul 24, 2025
31 checks passed
@snowystinger snowystinger deleted the s2-calendar-dialog branch July 24, 2025 00:49
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.

5 participants