I recommend against implementing a drop-down as described in the article, even for simple use-cases. The resulting drop-down doesn’t support keyboard shortcuts such as pressing Tab to focus the drop-down, or pressing Space to open the drop-down and select a value, up/down arrows to select a value, or typing the first letter of a value to select it. This lack of functionality will slow advanced users down, and will prevent users with certain disabilities from using the page.
I would expect an article about implementing custom form elements to at least mention the technique of using a label to make your custom elements control an actual select element behind the scenes. With how useless this article is and how many ads are on the linked page, this submission is dangerously close to spam.
What are you talking about? There are no ads!
This comment is ridiculous! If you find a tutorial on web components which doesn’t implement accessibility standards then it’s useless? Please tell me this is an illusion. Apparently, you have never developed MVP’s for startups.