Skip to content

react-flatpickr no longer works with the monthSelectPlugin in version 4.0.10 #259

@bertoverflow

Description

@bertoverflow

Hello,

thanks for providing this library.

We are using your react wrapper for flatpickr with the monthSelectPlugin (https://flatpickr.js.org/plugins/#monthselectplugin).

Our code is roughly like that:

<Flatpickr
	ref={flatPickrRef}
	onChange={onFlatpickrChange}
	options={{
		plugins: [
			monthSelectPlugin({
				altFormat: "F Y",
				dateFormat: "F Y",
				shorthand: false,
			}),
		],
	}}
/>

This worked in version 3.10.13 of react-flatpickr. However, after updating to version 4.0.10 the month selector still works functionally, but throws an error whenever it closes:

TypeError: Cannot read properties of undefined (reading 'closeOnSelect')
  HTMLSpanElement.selectMonth ../../node_modules/flatpickr/dist/plugins/monthSelect/index.js:185:31
    183|                     return; // necessary??
    184|                 setMonth(eventTarget.dateObj);
    185|                 if (fp.config.closeOnSelect) {
       |                               ^
    186|                     var single = fp.config.mode === "single";
    187|                     var range = fp.config.mode === "range" && fp.selectedDates.length === 2;

We would really appreciate if you could have a look into this :) Do you need any more information?

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