Closed aroncal closed 3 months ago
Describe the bug Datepicker doesn't hide on date selection ('onChangeDate' event) with autohide=true.
Expected behavior It should hide.
Desktop (please complete the following information):
Additional context Inspecting /node_modules/flowbite-datepicker/dist/js/datepicker-full.js I see this 'hide' function:
hide() { if (!this.active) { return; } this.datepicker.exitEditMode(); this.element.classList.remove('active', 'block'); this.element.classList.add('active', 'block', 'hidden'); this.active = false; triggerDatepickerEvent(this.datepicker, 'hide'); }
I think the line in which classes are added, 'active' and 'block' shouldn't be there. If I remove them, it works as expected, like this:
hide() { if (!this.active) { return; } this.datepicker.exitEditMode(); this.element.classList.remove('active', 'block'); this.element.classList.add('hidden'); this.active = false; triggerDatepickerEvent(this.datepicker, 'hide'); }
Hey @aroncal,
We pushed a new update with v2.4.1 for the datepicker. Please check the upgraded API and examples:
v2.4.1
https://flowbite.com/docs/components/datepicker/#javascript-behaviour
Cheers, Zoltan
Describe the bug Datepicker doesn't hide on date selection ('onChangeDate' event) with autohide=true.
Expected behavior It should hide.
Desktop (please complete the following information):
Additional context Inspecting /node_modules/flowbite-datepicker/dist/js/datepicker-full.js I see this 'hide' function:
I think the line in which classes are added, 'active' and 'block' shouldn't be there. If I remove them, it works as expected, like this: