Skip to content

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

Open
@Persists

Description

@Persists

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions