htmlstreamofficial / preline

Preline UI is an open-source set of prebuilt UI components based on the utility-first Tailwind CSS framework.
https://preline.co
Other
4.9k stars 309 forks source link

feat: better auto init #440

Closed oliverhaas closed 3 months ago

oliverhaas commented 3 months ago

This PR fixes a memory leak of autoInit() of several components.

In addition, autoInit() now allows to pass an html element, so that the autoInit() happens only on that element (and children) and not always on the whole document. This makes using autoInit() with small ajax partials more efficient.

langscot commented 3 months ago

See https://github.com/htmlstreamofficial/preline/discussions/438. How does your PR solve the memory leak issue? Apologies, I've read through your changes but it is not immediately obvious to me. Nice work though!

oliverhaas commented 3 months ago

Sorry I've deleted my previous PR, since it was too much of a mess. Here is the new one https://github.com/htmlstreamofficial/preline/pull/441.