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) {
|
||||
console.log('Load status:', status);
|
||||
if (status == "success") {
|
||||
console.log('Showing modal with jQuery');
|
||||
// Use jQuery/Bootstrap method which handles initialization automatically
|
||||
$('#editAcct').modal('show');
|
||||
console.log('Initializing Bootstrap 5 modal');
|
||||
var modalEl = document.getElementById('editAcct');
|
||||
|
||||
// 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 {
|
||||
console.error('Failed to load modal content:', xhr.statusText);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user