jacobmischka / svelte-flatpickr

Flatpickr component for Svelte.
https://www.npmjs.com/package/svelte-flatpickr
MIT License
160 stars 23 forks source link

I just found out another crazy issue! #59

Open frederikhors opened 1 year ago

frederikhors commented 1 year ago

I just found out another crazy issue!

REPL: https://svelte.dev/repl/c3a6591167c34bb48d28966fe83b22f2?version=3.59.1

If you click on the button "Toggle Flatpickr" the Flatpickr renders and works with date:

image

But if you use the mobile version of the browser and click the button two times to re-render it, it throws!

image

Uncaught (in promise) TypeError: Cannot set properties of undefined (setting 'tabIndex')
    at buildMonthSwitch (eval at handle_message (about:srcdoc:14:8), <anonymous>:1723:51)
    at jumpToDate (eval at handle_message (about:srcdoc:14:8), <anonymous>:1484:17)
    at Object.setDate (eval at handle_message (about:srcdoc:14:8), <anonymous>:2823:13)
    at $$self.$$.update (eval at handle_message (about:srcdoc:14:8), <anonymous>:3457:13)
    at update (eval at handle_message (about:srcdoc:14:8), <anonymous>:335:16)
    at flush (eval at handle_message (about:srcdoc:14:8), <anonymous>:299:21)

This happens in mobile only!

Why? What's the problem?

frederikhors commented 1 year ago

Another crazy thing is it works if I use this date: 2023-05-30T04:31:16Z and does not work if I use this instead: 1948-05-28T10:37:43Z!

frederikhors commented 1 year ago

I think the issue is this: https://github.com/flatpickr/flatpickr/issues/2367.

Flatpickr seems abandoned today unfortunately.

RickyRivas commented 1 month ago

Did you ever figure this out? Svelte Flatpickr on Sveltekit v2 doesn't work on mobile at all