Tuix.Event.Input (tuix v0.1.3)

Copy Markdown View Source

Delivered when a focused input's value changes.

Inputs are controlled: the app owns the value, so it should assign value back into state (or a transformation of it — e.g. to enforce a format) for the change to appear:

def handle_event(%Tuix.Event.Input{id: :email, value: value}, app),
  do: {:noreply, assign(app, email: value)}

Summary

Types

t()

@type t() :: %Tuix.Event.Input{id: term(), value: String.t()}