by kristiandupont · 3y ago · 0 comments
There's literally no reason to write your own implementation of a drop-down menu. Zero. None.
And yet, I occasionally run into a site where I need to enter my mailing address, and they have a drop-down menu to choose my state. In a native component, I can just tab to it, type "or", and Oregon (or OR if they're using the abbreviation) will be chosen, and I can just tab on to the next input field.
But every now and then, I find myself on a form where that doesn't work. It turns out, what looks like a drop-down menu is actually a fancy div, and when you click on it, another div pops up with divs for each item. Oh, but I can't even use my keyboard to choose an option! I HAVE to click!
WHY DO WEB DEVS DO THIS!? What was gained by this? Someone spent time to reimplement something for absolutely zero gain, and a LOT of loss! WHY!?
And my complaints don't even begin to address how the custom solution is probably awful for accessibility.
You don't need to make a custom button.
You don't need a custom date picker.
I'm struggling to think what custom components you think need to be made.
So instead of design being the intersection of form and function, design becomes entirely detached from the function.
It does not require the developer to completely rebuild the component behavior from scratch using JavaScript.