Closed dkern closed 2 years ago
If i remember correctly, Bootstrap adds the event listeners in the component files within the individual component files, so when I tried to import them it would make two instances of the modal backdrop on click and mess up carousel navigation. I'm certain there's a better way where the BS5 code can be reused, I just don't know what it is yet.
I'd suggest to add bootstrap
as an NPM dependency and to import the package as-is. This provides a way to create a bundled version, but does not influence use cases which import their own bootstrap
package.
This would make the local imports from ./bootstrap/model
and ./bootstrap/carousel
obsolete, and the custom declaration for bootstrap
can be replaced with a proper import:
import * as bootstrap from 'bootstrap';
That’s the plan, and Bootstrap is already listed as a dependency. The problem, if I remember correctly, comes from compiling the CDN version, where importing from Bootstrap bundles the entire package. I’ll fix this in the next release.
Hello,
I was about to use your lightbox, because it would fit my needs and works great so far. But why do you bundle
carousel
andmodal
within the script file? If a site already uses BS5, why not reuse the code, instead of include it twice?