4 ms·
I think the idea behind a native datepicker for <input> fields is good. But the fact I can't customize the design and UX of the datepicker interface, it always
by yvoschaap 9y ago
I think the idea behind a native datepicker for <input> fields is good. But the fact I can't customize the design and UX of the datepicker interface, it always ends up being replaced by some javascript library where I can.
Same goes for the <select> input. The native one is usually always replaced by a custom designed one.
- oliv__ 9y agoAgreed. You should really be able to fully style those inputs with bare CSS. Would make life so much easier!
- majewsky 9y agoOkay, please write a proposal for how to select parts of this widget with CSS. Remember, it must be compatible with all major browsers and across all formfactors (mobile, desktop, 10-inch, automotive, etc.). I'll schedule an appointment for a review in 2020, since I don't expect you to be finished earlier than that.
- amelius 9y agoThat's why they should have written the controls in Javascript and put it on their CDN, or include it in the browser distribution. Then using the controls would only require a simple include in the head of the document, and you could style the controls just like any other HTML.
- keganunderwood 9y agoNo, push back against insane requirements. Why do we want to style input? Bill them for a custom solution if they want a custom solution.
- dbbk 9y agoThere are already ways to style native UI widgets, you can even style scrollbars...
- jhasse 9y agoStyling scrollbars isn't really supported in Firefox IIRC. I hope it stays that way.
- yorwba 9y agoWhy do you need to be able to control the look of the date picker (or any other input element)? If every website used the same, it would be much more convenient than the current situation, where each date picker uses a subtly different mechanism to select the individual fields and then confirm the selected date. Most do not even support keyboard input.
- nkristoffersen 9y agoThe best reason for using native form fields (in my experience) is for the mobile devices. Using some old school Jquery custom JS select input means its a very poor experience for mobile. At least on iOS by using native, I get the Safari mobile dates/select inputs that work much better+smoother than js/css alternatives. Of course this doesn't matter if you don't target mobile with your website/webapp.
- pault 9y agoIt’s possible to have both; just make your js component issue a synthetic click on a hidden native input, and read the value when changed. I do this all the time.
- Piskvorrr 9y agoAnd oh the fun you'll have when you try to use a keyboard! (Nope nope nope, everyone clicks, you with the keyboard don't matter, and you with the screenreader just go away already)
- pault 9y agoThe idea is that you are using the native field to listen for user events, so the ux shouldn’t change. You have to proxy click events since the element isn’t visible, but key presses work as usual.