4 ms·
The 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
by nkristoffersen 9y ago
The 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.