Performance: Dropdown directions (up, left, right)
MEDIUM IMPACT
This affects how dropdown menus render and how quickly they appear on user interaction.
<div class="dropup"> <button class="btn btn-secondary dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false">Dropdown</button> <ul class="dropdown-menu">...</ul> </div>
<button class="btn btn-secondary dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false">Dropdown</button> <ul class="dropdown-menu" style="top: auto; bottom: 100%; left: auto; right: auto;">...</ul>
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Inline styles for dropdown direction | Minimal | Multiple on toggle | High due to forced repaint | [X] Bad |
| Bootstrap directional classes (dropup, dropdown-menu-end) | Minimal | Single on initial render | Low, GPU accelerated | [OK] Good |