Performance: Select dropdown
MEDIUM IMPACT
This affects page load speed and interaction responsiveness because select dropdowns involve rendering native UI components and can trigger layout recalculations when opened.
<label for="select-example">Choose an option:</label> <select id="select-example" name="options"> <option value="1">Option 1</option> <option value="2">Option 2</option> <option value="3">Option 3</option> </select>
<div class="custom-dropdown"> <div class="selected">Choose an option</div> <ul class="options"> <li>Option 1</li> <li>Option 2</li> <li>Option 3</li> </ul> </div>
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Native <select> | Minimal nodes (1 select + options) | 1 on load, 1 on open | Low paint cost | [OK] Good |
| Custom dropdown with divs and lists | Many nodes (divs, ul, li) | Multiple on open/close | High paint cost | [X] Bad |