Hello,
Here is my scenario.
I have a form with multiple steps. Each step display a set of input fields. Some of these fields are required and others optional.
The form is backed by a Ecto.Changeset that provides the validation for these fields.
The problem I am running into is when I am on any of the steps, the validation errors for the fields work properly and show up under the fields (i.e Email is invalid etc.)
When I navigate to some other step that displays a different set of fields and then navigate back to the first step, the field error in the previous step is not being displayed. This is due to the input field is under the div with the “phx-no-feedback” class set.
I am wondering what the right approach would be
Remove the “phx-no-feedback” class from the parent when there is an error. If so, when I can I send the push_event
- meaning I don’t know how to send the event after the form is rendered. The lifecycle is mount --> update --> render
- and I am not sure how to apply any event either using JS or push_event
after the LiveView with the component is rendered.