Not published yet
Delete the JavaScript From Your First Dropdown
Your dropdown won’t close on an outside click, so you added more script. The browser does the toggle, click-outside and Escape itself — with the ‘popover’ attribute and zero listeners.
Your hand-built dropdown won’t close when you click away, stays open after you pick an item, or gets clipped by a parent card — so you keep piling on script. In 2026 the browser does the toggle, the click-outside and the Escape key itself: one ‘popover’ attribute, no listeners. This builds it in a single HTML file, shows exactly what you get to delete, adds optional CSS anchor positioning to place it, and is honest about the one thing — arrow keys — that still needs a little script. Reproduced in headless Chromium; check current browser support on caniuse before you ship.