Replies: 3 comments 13 replies
-
Can you try running it outside the scope of the iife?
|
Beta Was this translation helpful? Give feedback.
0 replies
-
Try without the leading var myModal = new Modal(document.getElementById('exampleModal'), {
keyboard: false
}); See #1583. You could also change the click shorthand to jQuery("a.dashicons-search").on("click",function(){
myModal.toggle();
}); |
Beta Was this translation helpful? Give feedback.
10 replies
-
The method we've used pretty consistently is import Modal from 'bootstrap/js/src/modal';
let modal = new Modal( document.getElementById('example-id') );
modal.show(); or another one: import Tooltip from 'bootstrap/js/src/tooltip';
var tooltipTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]'))
var tooltipList = tooltipTriggerList.map(function (tooltipTriggerEl) {
return new Tooltip(tooltipTriggerEl)
}) |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am trying to use Bootstrap's Modal component. I am getting a "bootstrap is not defined" error though. Here is the relevant js. What am I doing wrong?
Beta Was this translation helpful? Give feedback.
All reactions