Skip to content

Commit a41fc03

Browse files
committed
fix (attachFlatpickr) : yearDropdownPlugin not load in default value of parameter plugins
1 parent f41d74e commit a41fc03

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "svelte-flatpickr-plus",
3-
"version": "2.0.6",
3+
"version": "2.0.7",
44
"description": "Flatpickr is a lightweight and powerful datetime picker. Svelte Flatpickr Plus is a wrapper for Flatpickr with some extra features.",
55
"homepage": "https://github.com/kodaicoder/svelte-flatpickr-plus",
66
"bugs": {

src/lib/actions.svelte.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,8 +228,11 @@ function resetFlatpickr(event, fp, opts) {
228228
* @param {[*]} plugins
229229
* @returns
230230
*/
231-
function attachFlatpickr(node, opts, plugins = opts.noCalendar ? [] : [yearDropdownPlugin()]) {
231+
function attachFlatpickr(node, opts, plugins = []) {
232232
node.setAttribute('autocomplete', 'off');
233+
if (!opts.noCalendar) {
234+
plugins.push(yearDropdownPlugin());
235+
}
233236
if (!opts.allowInput) {
234237
node.setAttribute('readonly', 'true');
235238
}

0 commit comments

Comments
 (0)