https://github.com/Phanx/PhanxConfig...ngDropdown.lua
It even scrolls long lists, and unlike Ace3 scrolling dropdowns, auto-scrolls the selected entry into view. Feel free to use it as a base, or just use it, though it's not officially "released" so I'd recommend renaming yours so my arbitrary API changes don't break your addon.