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
After 0.12.0, Form is deprecated; users are supposed to convert to the plain live_view functional component .form. However, .form does not convert the surface event; so it is a bit awkward now to use forms.
Edit: Oops, I should have filed the issue against surface, not surface_form_helpers
How to reproduce it
<.form :on-submit={@submit} ...>
does not work. @submit is a Surface event, not a string, so it cannot serialize to HTML.
<.form :on-submit={@submit.name} ...>
does not work either; the :on-submit is passed through to html without conversion.
I have to do this:
<.form phx-submit={@submit.name} ...>
Which is less than optimal. BTW: the :if={} directive works for .form
I like functional components, they can be considered as a light weight version of components (no hooks, no css...). However, their usage need to be normalized with module components and html tags to avoid confusion for developers.
Your Environment
Surface: v0.12.0
LiveView: v0.20.12
Elixir: v1.15
The text was updated successfully, but these errors were encountered:
Describe the bug
After 0.12.0,
Form
is deprecated; users are supposed to convert to the plain live_view functional component.form
. However,.form
does not convert the surface event; so it is a bit awkward now to use forms.Edit: Oops, I should have filed the issue against surface, not surface_form_helpers
How to reproduce it
does not work.
@submit
is a Surface event, not a string, so it cannot serialize to HTML.does not work either; the
:on-submit
is passed through to html without conversion.I have to do this:
Which is less than optimal. BTW: the
:if={}
directive works for.form
I like functional components, they can be considered as a light weight version of components (no hooks, no css...). However, their usage need to be normalized with module components and html tags to avoid confusion for developers.
Your Environment
Surface: v0.12.0
LiveView: v0.20.12
Elixir: v1.15
The text was updated successfully, but these errors were encountered: