bs5-utils icon indicating copy to clipboard operation
bs5-utils copied to clipboard

Fix issue when bootstrap is not fully imported

Open PastisD opened this issue 3 years ago • 0 comments

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.

PastisD avatar Feb 15 '22 14:02 PastisD