Skip to content

Better form handling #119

@bontaq

Description

@bontaq

Since diffing right now is just at the handler level, and always replaces everything beneath it, people could get a pretty jarring surprise when working with a form. For example, they add an onBlur to an input in the form for validation, and other fields already filled in are blanked when the DOM updates with an error.

If they changed the position of the form in the DOM by some means, I also think it would be blanked.

Take an initial stab at it working for a very simple case:

  • A form with an email and password
  • The password has an onBlur validation that fails and displays an error message beneath the password field
  • The entered email should not be overwritten or blanked when the error message is added

It's kind of a weird space, for example in react (or in purview right now) I think you'd make each a controlled component that sets form values on blur. I also recall this issue in liveview. Forms are tricky!

Worth a shot anyways although I imagine there's some secret downside to diffing more.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions