You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to create a form for a schema which has polymorphic_embeds_many field using polymorphic_embed_inputs_for but the validation errors are not shown on the inner forms when I use the base input core component.
Below is a minimum example using the schemas defined in the documentation (MyApp.Channel.Email and MyApp.Channel.SMS are omitted for brevity) and the code for my LiveView.
Inputing invalid values in the inner fields does not show any error while it does for the outer field. Am I doing something wrong with the way I build my form ?
After looking around a bit, I see that the errors are properly set on the inner fields but they are not displayed and this is related to the use of Phoenix.Component.used_input?/1 in the input core component. I was able to make it work by modifying a few lines of to_form in PolymorphicEmbed.HTML.Helpers but I'd like to know if I am properly constructing my form before going there.
Hi and thanks for the great work !
I'm trying to create a form for a schema which has
polymorphic_embeds_many
field usingpolymorphic_embed_inputs_for
but the validation errors are not shown on the inner forms when I use the baseinput
core component.Below is a minimum example using the schemas defined in the documentation (
MyApp.Channel.Email
andMyApp.Channel.SMS
are omitted for brevity) and the code for my LiveView.Inputing invalid values in the inner fields does not show any error while it does for the outer field. Am I doing something wrong with the way I build my form ?
After looking around a bit, I see that the errors are properly set on the inner fields but they are not displayed and this is related to the use of
Phoenix.Component.used_input?/1
in theinput
core component. I was able to make it work by modifying a few lines ofto_form
inPolymorphicEmbed.HTML.Helpers
but I'd like to know if I am properly constructing my form before going there.The text was updated successfully, but these errors were encountered: