Skip to content

selectionAlignment is not exposed in CalendarProps #8149

Open
@Cyral

Description

@Cyral

Provide a general summary of the issue here

I want to be able to create multi-month calendars where the first month is always the current month, rather than centering the current month. Looking through the code to see how the month is centered (so I could reverse it), I found that this is actually already an option in useCalendarState with selectionAlignment. However, the selectionAlignment is not included in the CalendarProps or RangeCalendarProps, so TypeScript complains, even though adding <Calendar selectionAlignment="center"> fixes the issue for Calendar components, although not RangeCalendar components, where the code is set to always center it (cannot be specified by the RangeCalendarStateOptions)

For example, with it being April, I want to see a visibleDuration={months:3} calendar that looks like:

April | May | June

Rather than:

March | April | May

🤔 Expected Behavior?

Calendar and RangeCalendar props should include the following, like useCalendarState line 54:

 /** Determines how to align the initial selection relative to the visible date range. */
  selectionAlignment?: 'start' | 'center' | 'end'

😯 Current Behavior

selectionAlignment is not exposed

💁 Possible Solution

No response

🔦 Context

No response

🖥️ Steps to Reproduce

<Calendar selectionAlignment="start"> works because the props are passed to useCalendarState, but TypeScript complains that selectionAlignment doesn't exist.

Version

3.39.0

What browsers are you seeing the problem on?

Chrome

If other, please specify.

No response

What operating system are you using?

Mac

🧢 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