Notes

Replacing `phx-feedback-for` directive in Phoenix LiveView

07 June 2024

Phoenix provided a phx-feedback-for directive to help with styling form error messages (Phoenix Form Bindings).

This has been removed in LiveView 1.0 in favour of the used_input/1 function.

It's a simpler concept now:

<input type="text" name={@form[:title].name} value={@form[:title].value} />

<div :if={used_input?(@form[:title])}>
  <p :for={error <- @form[:title].errors}><%= error %></p>
</div>