Skip to content

Instantly share code, notes, and snippets.

@rehno-lindeque
Last active January 12, 2016 03:44
Show Gist options
  • Save rehno-lindeque/a0025a41da2dfc2ba8b2 to your computer and use it in GitHub Desktop.
Save rehno-lindeque/a0025a41da2dfc2ba8b2 to your computer and use it in GitHub Desktop.
Wishlist for Elm form controls

(TLDR; This is a super naive list, just a few quick thoughts)

I was thinking that perhaps having some kind of % coverage for things that people will need in practice in order to use Elm for rapidly creating nice GUIs. However, I also think there needs to be some kind of (mental, at a minimum) framework for people to work inside so that new controls are easily extensible, styling agnostic, work uniformly with other form controls + validation etc before it can really become mainstream. I'll start adding some thoughts here over time (not much time now) - however, this doesn't cover the second point and I think people still need to get into that before things can really progress very far.

Form handling

Inputs fields

  • display masking (e.g. static slashes and colons for __/__/__, __:__:__ formatting)
  • simple inline dropdowns (e.g. dropdown/typeahead for 10 [days/months/years ▼]) and so on.
  • ultra-customizable and fast typeahead list
    • I have a reasonbly ok typeahead control I can share, mostly just need to extract a package.
    • Mainly it's missing "effectful" typeahead where ajax is used to fetch results.
  • Abstracted numeric/date/etc inputs that don't require both a view model and a domain model (unless, optionally, access to the view model is desired in order to do further detailed customization)

Input handling

  • disable/enable form submit on ENTER key
  • idiomatic validation: elm-validate by @rtfeldman
    • disable submit + submit button on validation error
    • library with: ranges, numeric, regex etc
    • on events: ENTER key / on blur / on input (or some combination of validations per event type)
    • on asynchronous (ajax) check
    • default / user-friendly validation messages
  • keyboard input regex masking as opposed to display masking (e.g. only allow '+' or a decimal to be typed at first and then only decimals after that for telephone numbers +1 xxx xxxxx)

Pickers

  • date picker
  • color picker

Widgets

  • various sliders

Other

  • Modals

Probably need to look at other frameworks to get an exhaustive list going. Perhaps:

Please feel free to add your own wishes/arguments in a comment below. I haven't done much work on forms in a while my understanding of where things are might be quite out of date.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment