talonframework / talon

An app builder framework for Phoenix
MIT License
164 stars 9 forks source link

Support live form updates #16

Open smpallen99 opened 7 years ago

smpallen99 commented 7 years ago

As mentioned in #15, I'll be looking to use ExAdmin with my existing live form updates.

tmbb commented 7 years ago

How "live" should be form updates? You can have:

  1. forms being update when another client submits (easy, just send the new html with populated from the server, and set innerHTML on the JS side- effectively a page reload) or

  2. Forma updates keystroke by keystroke, google docs style. Cool but requires instrumenting all text fields with JS for this to work. Cosemirror (plaintext) and quilljs (rich text) already provide enough instrumentation to make it easy to implement realtime collaboration.

Which one of this options are you suggesting? Please not that the naïve solution to option 1 breaks option 2

smpallen99 commented 7 years ago

When I say live updates, I mean that fields changes will be saved on a field by field basis. Not that the form will be updated if 2 browsers are updating the same form at the same time.

tmbb commented 7 years ago

With a save button for every field? Or each time the input changes?

smpallen99 commented 7 years ago

A live updated form will provide the following:

smpallen99 commented 7 years ago

Of course, this will be an optional feature, when defining the form. It will be opt in.

tmbb commented 7 years ago

Making it opt in is smart. It avoids breaking changeser validation rules that depend on multiple fields.