bs5-utils
bs5-utils copied to clipboard
Fix issue when bootstrap is not fully imported
Hello,
When each bootstrap module is imported individually, for exemple, import {Alert, Collapse, Dropdown} from 'bootstrap' in your application, an error occured using Bs5Utils : Uncaught ReferenceError: bootstrap is not defined
In the case of Modal, instead of using const bsModal = new bootstrap.Modal(modal, opts); we now use bootsrap module :
import {Modal as ModalBs} from "bootstrap";
const bsModal = new ModalBs(modal, opts);
With this fix, the error doesn't occur anymore for Modal, Toast and Snack.