Skip to content

CalendarCell outside the current month receive focus incorrectly in multi-month view #8128

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

Open
Persists opened this issue Apr 22, 2025 · 1 comment · May be fixed by #8129
Open

CalendarCell outside the current month receive focus incorrectly in multi-month view #8128

Persists opened this issue Apr 22, 2025 · 1 comment · May be fixed by #8129

Comments

@Persists
Copy link
Contributor

Provide a general summary of the issue here

The issue arrises In the Calendar component, when rendering the Calendar with multiple months (i.e., when visibleDuration > 1). Cells outside the current month receive focus instead of cells within the actual month.

This happens unless display: none is applied to cells with isOutsideMonth.

🤔 Expected Behavior?

The focus should be set only on the cells that represent dates within the current month. Cells outside the current month (in the next month) should not receive focus.

😯 Current Behavior

Cells outside the current month (in the next month) receive focus instead of the cells within the month, when the cells with isOutsideMonth are not hidden with display: none.

Screen.Recording.2025-04-22.at.15.41.25.mov

💁 Possible Solution

Currently, both the outside-month cell and the actual in-month cell receive focus because the isCellFocused function doesn't check whether a cell is outside the month. This could be fixed by adding an argument to the useCalendarCell hook to prevent focusing cells that are outside the month.

🔦 Context

No response

🖥️ Steps to Reproduce

Sandbox

navigate the focus with arrowkeys ([focus 28.10.2023] -> arrowRight)

Version

latest

What browsers are you seeing the problem on?

Firefox

If other, please specify.

No response

What operating system are you using?

MacOs

🧢 Your Company/Team

No response

🕷 Tracking Issue

No response

@Persists Persists linked a pull request Apr 22, 2025 that will close this issue
5 tasks
@Persists
Copy link
Contributor Author

I added a PR which should solve this issue.

Let me know if there are any further adjustments needed.

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 a pull request may close this issue.

1 participant