Limits of Bootstrap 5.3 Modal Backdrop Click-to-Close When Using data-bs-backdrop='static'
24.5K reputation · 31 Aug 2026, 13:41 UTC
Goal
Determine whether Bootstrap 5.3 attaches the backdrop click listener to a modal that is initialized only through HTML data attributes (e.g., data-bs-toggle="modal" and data-bs-target) before any user interaction occurs, particularly when data-bs-backdrop="static" is set.
Constraints / Uncertainty
The official documentation states that the listener is added during modal initialization, but an ongoing discussion in the Bootstrap repository questions whether the listener is deferred until the first click event, which could cause a delay in backdrop‑close behavior for static backdrops.
- Does the backdrop click listener fire immediately on the first backdrop click for a modal initialized via data attributes alone?
- If there is a delay, how does it affect the perceived behavior when
data-bs-backdrop="static"prevents closing via backdrop?