Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feedback about form-validation #12

Open
AshGhannam opened this issue Jun 17, 2024 · 0 comments
Open

Feedback about form-validation #12

AshGhannam opened this issue Jun 17, 2024 · 0 comments

Comments

@AshGhannam
Copy link

The view is crashing after entering the first letter in name :
10:07:42.679 [debug] HANDLE EVENT "validate_product" in PageLive
Parameters: %{"_target" => ["product", "name"], "product" => %{"description" => "", "name" => "a"}}

10:07:42.679 [debug] Replied in 204µs

10:07:42.679 [error] GenServer #PID<0.2407.0> terminating
** (ArgumentError) errors were found at the given arguments:

  • 2nd argument: not a tuple

    :erlang.element(1, "cannot be empty")
    (liveview_playground 0.1.8) lib/liveview_playgroud/core_components.ex:298: anonymous fn/1 in LiveviewPlaygroundWeb.CoreComponents."input (overridable 1)"/1
    (elixir 1.17.0) lib/enum.ex:1703: Enum."-map/2-lists^map/1-1-"/2
    (liveview_playground 0.1.8) lib/liveview_playgroud/core_components.ex:298: LiveviewPlaygroundWeb.CoreComponents."input (overridable 1)"/1
    (phoenix_live_view 0.20.14) lib/phoenix_live_view/tag_engine.ex:92: Phoenix.LiveView.TagEngine.component/3
    form.exs:56: anonymous fn/2 in PageLive.render/1
    (phoenix_live_view 0.20.14) lib/phoenix_live_view/diff.ex:368: Phoenix.LiveView.Diff.traverse/7
    (phoenix_live_view 0.20.14) lib/phoenix_live_view/diff.ex:546: anonymous fn/4 in Phoenix.LiveView.Diff.traverse_dynamic/7
    Last message: %Phoenix.Socket.Message{topic: "lv:phx-F9m449ENCYC3Xp0D", event: "event", payload: %{"event" => "validate_product", "type" => "form", "uploads" => %{}, "value" => "product%5Bname%5D=a&product%5Bdescription%5D=&_target=product%5Bname%5D"}, ref: "11", join_ref: "9"}
    State: %{socket: #Phoenix.LiveView.Socket<id: "phx-F9m449ENCYC3Xp0D", endpoint: LiveviewPlayground.Endpoint, view: PageLive, parent_pid: nil, root_pid: #PID<0.2407.0>, router: LiveviewPlayground.Router, assigns: %{form: %Phoenix.HTML.Form{source: %{"description" => "", "name" => ""}, impl: Phoenix.HTML.FormData.Map, id: "product", name: "product", data: %{}, action: nil, hidden: [], params: %{"description" => "", "name" => ""}, errors: [], options: [], index: nil}, flash: %{}, changed: %{}, live_action: :index}, transport_pid: #PID<0.2403.0>, ...>, components: {%{}, %{}, 1}, topic: "lv:phx-F9m449ENCYC3Xp0D", serializer: Phoenix.Socket.V2.JSONSerializer, join_ref: "9", upload_pids: %{}, upload_names: %{}}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant