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

Firing change event #22

Open
justinperkins opened this issue Sep 29, 2023 · 2 comments
Open

Firing change event #22

justinperkins opened this issue Sep 29, 2023 · 2 comments

Comments

@justinperkins
Copy link

Currently when the date value is assigned, no change event is fired, which means that when you've got custom event listeners for change events, they won't fire when a date in the picker is chosen.

@xirukitepe
Copy link

Hi @justinperkins

Did you manage to get this working? 🤔

@justinperkins
Copy link
Author

Did you manage to get this working? 🤔

I did actually, through looking at the Flowbite datepicker source code I found that a custom event is emitted on the related input control, so you can use that to trigger custom code when a date is chosen.

Basically, if you observe for the changeDate event on your input, it will be fired when a date is chosen in the Flowbite datapicker UI.

Related Flowvite JS here:

triggerDatepickerEvent(datepicker, 'changeDate');

And here:
https://github.com/themesberg/flowbite-datepicker/blob/master/js/events/functions.js#L4

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

2 participants