79740929

Date: 2025-08-20 10:11:50
Score: 1.5
Natty:
Report link

Instead of

$('#modal-location').on('shown.bs.modal', () => {
  initMap();
});

I used this.

$(document).on('shown.bs.modal', '#modal-location', () => {
    initMap();
});

and it works fine.
because it ensures initMap()) executes after the modal is actually visible in the DOM.

Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: Mr_Moh