Skip to content

RangeCalendar: When one date selectedΒ #5456

Closed as not planned
Closed as not planned
@thorbde

Description

@thorbde

Provide a general summary of the issue here

When selecting a date in RangeCalendar, and not having moved the cursor yet, the one date that is in selection acts as a [data-selection-end]. This causes styling issues for us:
Screenshot 2023-11-22 at 10 38 54

πŸ€” Expected Behavior?

I expect this cell to act as a [data-selected] before the selection is extended, as React Aria can't predict which direction the user will drag the selection.

😯 Current Behavior

React Aria predicts that the cell should act as [data-selection-end]

πŸ’ Possible Solution

No response

πŸ”¦ Context

No response

πŸ–₯️ Steps to Reproduce

Current CSS implementation:

&[data-selected] {
          color: INTERNAL COLOR VARIABLE;
          background: INTERNAL COLOR VARIABLE;

          &:hover {
            background: INTERNAL COLOR VARIABLE;
          }
        }
&[data-selection-start],
&[data-selection-end] {
          color: INTERNAL COLOR VARIABLE;
          /** This is to have two backgrounds, see screenshot above */
          &::after {
                    background: INTERNAL COLOR VARIABLE;
          }
}

Version

React-Aria-Components

What browsers are you seeing the problem on?

Firefox, Chrome, Safari, Microsoft Edge

If other, please specify.

No response

What operating system are you using?

MacOs Sonoma 14.0

🧒 Your Company/Team

No response

πŸ•· Tracking Issue

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    βœ… Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions