<turbo-stream action="append" target="posts_list"><template>    <div class="postbit" id="299059" data-post-id="299059">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="ahallock" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/ahallock/120/31647_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  ahallock
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>It should be OK since you’re only setting the ID on mount and the submit event. I also used a Hook to reset the field before I went back to the phx-change because the Hook felt like duct tape instead of a real solution.</p>
<p>I’m curious about the costs with using phx-change because I’m using it a lot on a new project <img src="https://forum.elixirforum.com/images/emoji/apple/sweat_smile.png?v=15" title=":sweat_smile:" class="emoji" alt=":sweat_smile:" loading="lazy" width="20" height="20"></p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="299059" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/form-in-live-component-not-resetting-on-phx-submit/57860/12">Post #11</a>
	                </div>
	            </div>
              <div id="likers-container-299059" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="299059"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #11"></div>
  </section>
</div>
    <div class="postbit" id="299118" data-post-id="299118">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="sodapopcan" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/sodapopcan/120/34668_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  sodapopcan
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I realized I completely read past the meaning of “random” in your original reply so sorry if my replies sounded inconsistent (I figured you meant a random hardcoded ID).</p>
<p>It still seems a bit cavalier to use a totally random one but maybe it’s fine if it’s just the form?  I’m trying to think of a scenario where the form would re-render and the ID would change.  But ya… I can’t atm.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="299118" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/form-in-live-component-not-resetting-on-phx-submit/57860/13">Post #12</a>
	                </div>
	            </div>
              <div id="likers-container-299118" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="299118"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #12"></div>
  </section>
</div>
    <div class="postbit" id="386303" data-post-id="386303">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="UncountedSphere" src="/assets/icons/user-9f439610.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  UncountedSphere
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I tried a couple of things, and changing the id is the only thing that worked for:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir"> def handle_event("add", %{"entry" =&gt; params}, socket) do
    case Paste.Entries.create_entry(params) do
      {:ok, entry} -&gt;
        {:noreply,
          socket
          |&gt; put_flash(:info, "entry #{entry.id} added")                                                
          |&gt; assign(
           form: to_form(
             Entries.change_entry(%Entry{}),
             id: "form-#{System.unique_integer()}"
           )
          )
          |&gt; stream_insert(:entries, entry, at: 0)}

      {:error, %Ecto.Changeset{} = changeset} -&gt;
        {:noreply, assign(socket, form: to_form(changeset))}
    end
  end
</code></pre> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="386303" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/form-in-live-component-not-resetting-on-phx-submit/57860/14">Post #13</a>
	                </div>
	            </div>
              <div id="likers-container-386303" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="386303"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-last-post cat-last-post" title="Last post!"></div>
  </section>
</div>
</template></turbo-stream><turbo-stream action="replace" target="load-more-container"><template><div id="load-more-container" class="load-more-container">
    <span class="all-loaded">— All posts loaded —</span>
</div></template></turbo-stream>