Performance: Scrollable and centered modals
MEDIUM IMPACT
This affects page interaction speed and visual stability when modals appear and scroll within the viewport.
<div class="modal fade" tabindex="-1" role="dialog"> <div class="modal-dialog modal-dialog-scrollable modal-dialog-centered" role="document"> <div class="modal-content"> <!-- content --> </div> </div> </div>
<div class="modal" tabindex="-1" role="dialog"> <div class="modal-dialog" role="document"> <div class="modal-content"> <!-- content --> </div> </div> </div>
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Basic modal without scrollable or centered classes | Low (few nodes) | Multiple reflows on large content overflow | High due to layout shifts | [X] Bad |
| Modal with modal-dialog-scrollable and modal-dialog-centered classes | Low (few nodes) | Single reflow on open | Low paint cost with stable layout | [OK] Good |