liveview-native / liveview-native/liveview-client-html

Simple form not valid inside of html template.

Open
#3 5 comments 0 reactions 1 assignee View on GitHub

@bcardarella is already working on this.

Since Nov 11, 2024.

Dominant language
Elixir
Stars
13
Forks
1
PR merge metrics
No merged PRs in 30d

Description

I noticed the simple_form component doesn't seem to work when using the liveview-client-html library with a render component.

Here's my template:

<h1 class="text-2xl">Chat App</h1>
<section class="h-[400px] overflow-y-scroll">
    <%= for message <- @messages do %>
    <p><%= message.name %></p>
    <p class="mb-2"><%= message.content %></p>
    <% end %>
</section>

<.simple_form for={@form} id="form" phx-submit="send-message">
    <.input field={@form[:name]} placeholder="From..." />
    <.input field={@form[:content]} placeholder="Say..." />
    <:actions>
        <.button type="submit">
            Send Message
        </.button>
    </:actions>
</.simple_form>

Here's my render component:

defmodule ChatWeb.ChatLive.HTML do
  use ChatNative, [:render_component, format: :html]
end

Very weirdly it's interpreted as text. (see the image below)

Screenshot 2024-08-23 at 11 50 24 AM

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.