LiveView: Form Errors Not Showing Up

Hello,

I am trying to figure out why my LiveView forms aren’t displaying errors. It looks like they are being set in the appropriate handle_event callback, but they are nowhere to be seen despite being printed in my templates. :man_shrugging:

You can find my code here: GitHub - danieljaouen/phoenix_modal_example · GitHub

With the most relevant code being located in lib/modal_example_web/live/modal_example_live.ex and lib/modal_example_web/live/modal_example_live.html.heex.

Any help is greatly appreciated. Thanks!

https://github.com/danieljaouen/phoenix_modal_example/blob/ab4055dff623e386f5565450a7c121fda0c12152/lib/modal_example_web/live/modal_example_live.html.heex#L14-L19

Try removing phx-update="ignore" from the modal divs that wrap your forms.

  • ignore - ignores updates to the DOM regardless of new content changes

    The “ignore” behaviour is frequently used when you need to integrate with another JS library. Note only the element contents are ignored, its attributes can still be updated.

source: https://hexdocs.pm/phoenix_live_view/dom-patching.html

Yep, that did the trick. Thanks, @codeanpeace!!