Use proper Bootstrap 5 native modal API with initialization
Bootstrap 5 removed jQuery plugin support, so .modal('show') doesn't work.
Switch back to native Bootstrap 5 Modal API with proper initialization:
- Dispose of any existing modal instance before creating new one
- Create modal with explicit options (backdrop, keyboard, focus)
- Add detailed console logging for each step
This ensures the modal is properly initialized before showing.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -56,9 +56,26 @@ function openEditModal(id){
|
|||||||
$("#editAcct .modal-content").load(link, function(response, status, xhr) {
|
$("#editAcct .modal-content").load(link, function(response, status, xhr) {
|
||||||
console.log('Load status:', status);
|
console.log('Load status:', status);
|
||||||
if (status == "success") {
|
if (status == "success") {
|
||||||
console.log('Showing modal with jQuery');
|
console.log('Initializing Bootstrap 5 modal');
|
||||||
// Use jQuery/Bootstrap method which handles initialization automatically
|
var modalEl = document.getElementById('editAcct');
|
||||||
$('#editAcct').modal('show');
|
|
||||||
|
// Ensure any existing instance is disposed
|
||||||
|
var existingModal = bootstrap.Modal.getInstance(modalEl);
|
||||||
|
if (existingModal) {
|
||||||
|
existingModal.dispose();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Create new modal with options
|
||||||
|
var modal = new bootstrap.Modal(modalEl, {
|
||||||
|
backdrop: true,
|
||||||
|
keyboard: true,
|
||||||
|
focus: true
|
||||||
|
});
|
||||||
|
|
||||||
|
console.log('Modal created, calling show()');
|
||||||
|
modal.show();
|
||||||
|
|
||||||
|
console.log('Modal should be visible now');
|
||||||
} else {
|
} else {
|
||||||
console.error('Failed to load modal content:', xhr.statusText);
|
console.error('Failed to load modal content:', xhr.statusText);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user