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

[Bug]: TextEditor's text not reset on form submission #30

Open
nighthawk opened this issue Jan 13, 2025 · 1 comment
Open

[Bug]: TextEditor's text not reset on form submission #30

nighthawk opened this issue Jan 13, 2025 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@nighthawk
Copy link

What happened?

My LVN template includes a <.form for={@comment_form}> with with a <TextEditor> for users to post a comment. This works except that the form isn't cleared after I submit it, even though I explicitly reset that comment_form.

It works fine in the HTML version.

The relevant part of the .neex looks like this:

<VStack spacing="0">
  <List>...</List>
  <Divider />

  <.form
    for={@comment_form}
    id="comment-form"
    phx-change="validate"
    phx-submit="save"
  >
    <HStack>
      <TextEditor id="content" name="comment[content]" />

      <LiveButton type="submit">
        <Image systemName="paperplane.circle.fill" />
      </LiveButton>
    </HStack>
  </.form>
</VStack>

And the handle_event("save", ...) then does this:

  def handle_event("save", %{"comment" => comment_params}, socket) do
    # code to save the comment...

     another_comment_changeset =
          %Comment{} |> Discussions.change_comment()

    {:noreply,
    socket
    |> assign(:comment_form, to_form(another_comment_changeset))}
  end

Library Version

0.4.0-rc.0

Xcode Version

16.2

Swift Version

6.0.3

On which device or simulator are you running into the problem?

iPad

Target Device Operating System Version

18.2

Relevant log output

No response

@nighthawk nighthawk added the bug Something isn't working label Jan 13, 2025
@bcardarella
Copy link
Contributor

@carson-katri I could have sworn we fixed this but @nighthawk hask said it's still happening on 0.4.0-rc.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants