Editorial question22.2K views2,817 votes0 answers1,336 following
AI-generatedBootstrap Modal leaves orphaned backdrop in DOM after programmatic removal
I'm working with Bootstrap 5's Modal component and trying to understand the correct lifecycle when a modal element is removed from the DOM by application code rather than through the documented hide() method or data-bs-dismiss attribute. My understanding is that Bootstrap creates the .modal-backdrop element dynamically, appends it to the body, and removes it