Skip to content

Range mode having max of 1 allows selecting on a range of two days #2739

@bcowell

Description

@bcowell

The week selection example no longer works. I'm trying to implement something similar with the ability to select multiple distinct week ranges, but there seems to be issues with the way max is working.

To reproduce

import { DayPicker } from "react-day-picker";
import "react-day-picker/style.css";

export default function App() {
  return <DayPicker mode="range" max={1} />;
}

Actual Behavior

Having range mode and a max of 1 allows selecting a range of two days.

Expected Behavior

Having range mode and a max of 1 allows selecting one day.

Screenshots

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions