Baremetrics / calendar

Date range picker for Baremetrics
MIT License
679 stars 78 forks source link

Question: Why not use input elements? #43

Closed tinyfly closed 8 years ago

tinyfly commented 8 years ago

Any particular reason you used contenteditable divs instead of traditional form input elements to hold the actual dates?

Doing it this way makes it harder to submit the dates through a regular form submit. Right now I'm doing it by syncing up the selected dates with hidden inputs within the form. Not super hard but I was wondering the advantages/disadvantages of not using inputs?

kalepail commented 8 years ago

Honestly I can't remember exactly what the rationale was at the time but I do know it was very intentional. It may have had something to do with truncating values in overflow situations. Sorry. You're welcome to switch to using inputs rather then divs but do so at your own risk.

tinyfly commented 8 years ago

Fair enough

Turbo87 commented 7 years ago

are you aware that using contenteditable (and obviously also <input> elements) will open the keyboard on Android devices? Is that expected behavior? It seems to work fine when I remove contenteditable, but maybe I'm not seeing the full picture yet...

kalepail commented 7 years ago

@Turbo87 Yeah as you can (or should) be able to edit those dates via the keyboard. There are also a number of shortcuts like ytd which will clamp the range to "year to date" etc. If you don't desire this behavior on mobile feel free to edit.