react-datepicker icon indicating copy to clipboard operation
react-datepicker copied to clipboard

Adding the `showMonthYearDropdown` prop on the datepicker causes the app to hang/become-unresponsive.

Open ParrotStone opened this issue 4 years ago • 7 comments

Describe the bug When I add the showMonthYearDropdown prop shown here on the DatePicker component, it kinda crashes/hangs the whole app, I'd have to restart the app or open it again in another tab.

To Reproduce, go to this codesandbox

Expected behavior The dropdown of both months & years to appear without the hassle and the app crashes/hangs.

Desktop (please complete the following information):

  • OS: [Linux]
  • Browser [Chromium, Firefox]

Additional context This error is consistent regardless of React version, I tried it with React 16.13 & 17.0

ParrotStone avatar Nov 23 '20 10:11 ParrotStone

I'm experiencing the same thing. Using React 16.13.1 and Chrome 88 here. Any update on this bug?

hufftheweevil avatar Feb 05 '21 19:02 hufftheweevil

I have the same issue. Just to clarify, as this is missing from the original bug description:

The DatePicker renders fine, and you can also select dates fine in the above sandbox. The app begins to "freeze" as soon as you want to open the montYearDropdown. There is no error in the console or anything.

TkDodo avatar Mar 04 '21 18:03 TkDodo

If you go to https://reactdatepicker.com/#example-monthyear-dropdown and then try to open montYearDropdown, it also does not open. The date picker crashes with error as follows (same error appears in console) -

Error: Minified React error #188; visit https://reactjs.org/docs/error-decoder.html?invariant=188 for the full message 
or use the non-minified dev environment for full errors and additional helpful warnings.

As per the link of the error decoder, the full text of the error is:

Unable to find node on an unmounted component.

OmkarRajam avatar Mar 31 '21 18:03 OmkarRajam

The same issue with month year dropdown.
React v16.13.1; react-datepicker 3.7.0; Browser: chrome 89.0.4389.90 (Official Build) (x86_64), OS: macOS Catalina v10.15.6; Any updates of this bug?

vantsymbalenko avatar Apr 05 '21 09:04 vantsymbalenko

I have the similar issue: I added datepicker with minDate and maxDate values and in this case datepicker works fine. when I remove props minDate and maxDate the app crashes when I try to open month selector

"react": "17.0.2", "react-datepicker": "^3.8.0", browser: chrome 92.0.4515.107 os: win10 home 19041.1110

StanBorovko avatar Jul 29 '21 10:07 StanBorovko

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Aug 13 '22 06:08 stale[bot]

Any chance of this issue getting fixed. Been opened for nearly two years now...

ParrotStone avatar Aug 13 '22 07:08 ParrotStone

I managed to fix this hang by specifying the dateFormatCalendar, minDate and maxDate props. My theory is the dropdown needs the min/max dates to give the dropdown its range and not specifying them causes it to infinite loop.

 dateFormatCalendar={"MMM yyyy"}
 minDate={dayjs().subtract(7, 'month').toDate()}
 maxDate={dayjs().add(7, 'month').toDate()}

garethterrace avatar Oct 21 '22 08:10 garethterrace