Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Close not working using Rails 7 import maps and turbo version #32

Open
ferrisoxide opened this issue Dec 13, 2023 · 0 comments
Open

Close not working using Rails 7 import maps and turbo version #32

ferrisoxide opened this issue Dec 13, 2023 · 0 comments

Comments

@ferrisoxide
Copy link

ferrisoxide commented Dec 13, 2023

We're using datepicker.turbo via import maps (https://cdnjs.cloudflare.com/ajax/libs/flowbite/2.0.0/datepicker.turbo.js) and are seeing some strange behaviour.

On refreshing a page - which should fire off the turbo:load event - the datepicker won't close on selection of a date (i.e when you click on it in the calendar popup). Even more interesting, clicking on a date in the calendar widget highlights the previously selected date (if you click around multiple times). The date in the text box is correctly updated, but the selected date is the old value.

Escape and clicking off the widget still works.

We've tried using version 2.2.0 of the datepicker.turbo pack with the same issue.

Could this be turbo cache related? Has anyone else seen anything similar?

Edit: we've also tried to manually reinitialize the datepicker elements elsewhere in our JS but can't seem to find an exported constructor. Not core to the problem. The datepicker is being initialized, it just loses/changes behaviour after a page refresh.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant