mdbootstrap / TW-Elements

𝙃𝙪𝙜𝙚 collection of Tailwind MIT licensed (free) components, sections and templates 😎
https://tw-elements.com
MIT License
12.91k stars 1.62k forks source link

[Angular] - Datepicker re-initialization not wroking #2322

Closed asllanberishadev closed 8 months ago

asllanberishadev commented 8 months ago

Hi there,

I'm using Datepicker into a modal, which is a component. When opening the modal first time, it works just fine, but anytime after that datepicker crashes. So, clicking the input won't trigger the popup datepicker. I expect the datepicker popup to work each time modal is opened.

Code: Initialization in component: ngAfterViewChecked(): void { initTE({ Datepicker, Input }); }

In HMTL template I've just copy/pasted the first Basic example from the Datepicker docs.

Screenshot 2024-03-02 at 17 06 03 Screenshot 2024-03-02 at 17 06 16
iprzybysz commented 8 months ago

Hi @asllanberishadev, check out our Quick Start page and TW Elements Formats section where you'll find everything about initTE method. This method has an allowReinits option, which should fix this issue.

asllanberishadev commented 8 months ago

Thanks, fixed!