hypeserver / react-date-range

A React component for choosing dates and date ranges.
MIT License
2.6k stars 679 forks source link

Bug in color fallback values #642

Open midas-myth opened 9 months ago

midas-myth commented 9 months ago

Hi, there seems to be a bug, as there is no color in scope

https://github.com/hypeserver/react-date-range/blob/6f86ccac37ada8d3aa8282c36f38cbf0c0063dcb/src/components/DateRange/index.js#L123

aniruddhapw commented 7 months ago

can you assign me this issue

abdelrahmanes commented 6 months ago

Yeah, I have the same issue, it throws Uncaught ReferenceError: Cannot access 'color' before initialization

Gourav-Chouhan commented 6 months ago

Hi, there seems to be a bug, as there is no color in scope

https://github.com/hypeserver/react-date-range/blob/6f86ccac37ada8d3aa8282c36f38cbf0c0063dcb/src/components/DateRange/index.js#L123

If you want to just see the date ranges and not interact with it, you can disable pointer events for that div.

.rdrMonth {
  pointer-events: none !important;
}
70Ni commented 5 months ago

Found this solution:

Copy the code from the preview: https://hypeserver.github.io/react-date-range/#calendar

    <DateRange
                editableDateInputs={true}
                onChange={(item) => setState([item.selection])}
                moveRangeOnFirstSelection={false}
                ranges={state}
              />
Yuting411 commented 4 months ago

@70Ni Thank you for your suggestion. The method you provided was helpful.