Skip to content

Conversation

@AryanBagade
Copy link
Contributor

Closes #9427

✅ 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:

  1. Go to the Calendar docs Month & Year picker example
  2. Tab to the Month dropdown
  3. Type "JUL" - should cycle through January → June → July without losing focus
  4. Tab to Year dropdown - should move directly (not to grid first)
  5. Type "2025" - should update year without losing focus
  6. Click on a calendar cell - focus SHOULD move to the grid (existing behavior preserved)

🧢 Your Project:

Personal contribution (Author : Aryan Bagade aryan.com)

Copy link
Member

@snowystinger snowystinger left a comment

Choose a reason for hiding this comment

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

Thanks for the PR! would you mind adding some tests for this so we don't have a regression later?

Copy link
Member

@snowystinger snowystinger left a comment

Choose a reason for hiding this comment

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

Thanks for the attempt, if you used AI, I think it mislead you. Your tests passed both before and after the change and didn't appear to have anything to do with the changes. I've removed them and added a test for the change.

@snowystinger
Copy link
Member

Note to other reviewers, there is a usage in useRangeCalendarState's highlightDate, but I don't believe we need the setFocused(true) there as the calendar would already have focus in that case

Copy link
Member

@snowystinger snowystinger left a comment

Choose a reason for hiding this comment

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

Checked behaviour against Calendar/RangeCalendar month-and-year-pickers example as well

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Calendar Month/Year dropdown awkward autofocus behaviour (docs example)

2 participants