Performance: Modal sizes and positioning
MEDIUM IMPACT
This affects the page's rendering speed and visual stability when modals appear, impacting how quickly users see and interact with modal content.
<div class="modal fade" tabindex="-1"> <div class="modal-dialog modal-lg modal-dialog-centered"> <div class="modal-content"> <!-- content --> </div> </div> </div>
<div class="modal fade" tabindex="-1"> <div class="modal-dialog"> <div class="modal-content"> <!-- content --> </div> </div> </div>
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Default modal with dynamic size | Moderate (modal + backdrop nodes) | Multiple reflows on open and resize | Medium paint cost due to layout shifts | [X] Bad |
| Modal with fixed size and centered positioning | Moderate (same nodes) | Single reflow on open | Lower paint cost, stable layout | [OK] Good |