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


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I’m unable to get unpoly up-modal working with drab 0.7  As far as I can remember including &lt;%= Drab.Client.run(<span class="mention">@conn</span>) %&gt;  in your fragment used to work, but it appears there is some check to see if drab is already running, in any case the fragment is not updated.  I can call Drab.exec_elixir from the fragment which may be a workaround.</p>
<p>What is the correct way to have drab evaluate an html fragment pulled into a page?  I really only want to slick a submit button and parse the textfield values in the unpoly up-modal fragment.</p>
<p>On another note, I’m trying to get the shared commanders working but they dont’ seem to be getting the :page_loaded callbacks which makes grabbing session stuff much harder.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="70476" 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/drab-remote-controlled-frontend-framework-for-phoenix/3277/292">Post #291</a>
	                </div>
	            </div>
              <div id="likers-container-70476" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="70476"
                     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 #291"></div>
  </section>
</div>
    <div class="postbit" id="70477" data-post-id="70477">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>They don’t work well ‘together’ (unless you are very careful).  Generally if you have Drab on a page you usually don’t need unpoly.  Unpoly is useful for fast multi-page switching and such, Drab is better for single pages.  It would be nice if they cooperated well (or Drab subsumed Unpoly).  ^.^;</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="70477" 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/drab-remote-controlled-frontend-framework-for-phoenix/3277/293">Post #292</a>
	                </div>
	            </div>
              <div id="likers-container-70477" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="70477"
                     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 #292"></div>
  </section>
</div>
    <div class="postbit" id="70478" data-post-id="70478">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="OvermindDL1" data-post="293" data-topic="3277">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/overminddl1/48/2677_2.png" class="avatar"> OvermindDL1:</div>
<blockquote>
<p>They don’t work well ‘together’</p>
</blockquote>
</aside>
<p>Is it fixable?  If so what would fix it?</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="70478" 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/drab-remote-controlled-frontend-framework-for-phoenix/3277/294">Post #293</a>
	                </div>
	            </div>
              <div id="likers-container-70478" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="70478"
                     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 #293"></div>
  </section>
</div>
    <div class="postbit" id="70480" data-post-id="70480">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="jschoch" data-post="294" data-topic="3277">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/jschoch/48/16709_2.png" class="avatar"> jschoch:</div>
<blockquote>
<p>Is it fixable?  If so what would fix it?</p>
</blockquote>
</aside>
<p>It is, you just have to call some drab hooks manually via the unpoly registry to get it all hooked up again.  Might ask <a class="mention" href="/u/grych" rel="nofollow">@grych</a> for the specific commands necessary to tear down and fully rebuilt the drab state on page changes.  ^.^;</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="70480" 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/drab-remote-controlled-frontend-framework-for-phoenix/3277/295">Post #294</a>
	                </div>
	            </div>
              <div id="likers-container-70480" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="70480"
                     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 #294"></div>
  </section>
</div>
    <div class="postbit" id="70500" data-post-id="70500">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="grych" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/grych/120/5610_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  grych
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>Creator of Drab</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="jschoch" data-post="292" data-topic="3277">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/jschoch/48/16709_2.png" class="avatar"> jschoch:</div>
<blockquote>
<p>On another note, I’m trying to get the shared commanders working but they dont’ seem to be getting the :page_loaded callbacks which makes grabbing session stuff much harder.</p>
</blockquote>
</aside>
<p>Yes, this callbacks are only working with the “main” commander. Noticed to mention about this in docs. If you think all the callbacks from all commanders should be launched, create an issue on github, I will think about it.</p>
<aside class="quote no-group" data-username="jschoch" data-post="292" data-topic="3277">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/jschoch/48/16709_2.png" class="avatar"> jschoch:</div>
<blockquote>
<p>What is the correct way to have drab evaluate an html fragment pulled into a page?  I really only want to slick a submit button and parse the textfield values in the unpoly up-modal fragment.</p>
</blockquote>
</aside>
<p>I am not sure I understood the issue correctly, but you are putting the fragment of html, with drab-events, and want Drab to set up its events, yes?</p>
<p>If you are putting html fragments using Drab (with <code>poke</code> or <code>set_prop innerHTML: ...</code>), it is done automatically. If you are doing it on the client side, you need to evaluate this fragment to set up Drab events (drab-click etc) with JS method:</p>
<pre><code>Drab.enable_drab_on(node_or_selector)
</code></pre>
<p>I did not mention about it before in docs, treating it as a kind of private function, but I am going to add it.</p>
<aside class="quote no-group" data-username="OvermindDL1" data-post="293" data-topic="3277">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/overminddl1/48/2677_2.png" class="avatar"> OvermindDL1:</div>
<blockquote>
<p>or Drab subsumed Unpoly</p>
</blockquote>
</aside>
<p>Ha!<br>
Everyone is very welcome to create something like <code>Drab.Unpoly</code>. There is a <code>Drab.Module</code> behaviour to obey, it is not documented yet, but I will do it if someone is interested in adding Drab modules.<br>
As I decided before, I, personally, will rather stick with the drab core. The last js-framework-related module I wrote was <code>Drab.Query</code> <img src="https://forum.elixirforum.com/images/emoji/apple/wink.png?v=15" title=":wink:" class="emoji" alt=":wink:" 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="70500" 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/drab-remote-controlled-frontend-framework-for-phoenix/3277/296">Post #295</a>
	                </div>
	            </div>
              <div id="likers-container-70500" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="70500"
                     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 #295"></div>
  </section>
</div>
    <div class="postbit" id="70503" data-post-id="70503">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="grych" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/grych/120/5610_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  grych
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>Creator of Drab</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group quote-modified" data-username="OvermindDL1" data-post="281" data-topic="3277">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/overminddl1/48/2677_2.png" class="avatar"> OvermindDL1:</div>
<blockquote>
<p>It’d be nice if you could support this too:</p>
<p>&lt;input drab=“focus:input_focus(42) blur:input_blur()” /&gt;</p>
<p>So 42 would be appended to the end of the argument list of input_focus (so it should be the normal callback arity + 1) as that’d allow us to easily pass in context sensitive information per call in addition to the event and such as well.</p>
</blockquote>
</aside>
<p>I am currently working on it. The optional argument will be evaluated on the client, so you could give any valid JS expression.</p>
<p>Plus, what if we could set this optional argument for a dom tree? So this:</p>
<pre><code>&lt;div drab-commander='My.Commander' drab-argument='{datasource: "Repo.User"}'&gt;
  &lt;button drab-click="add_user"&gt;Add User&lt;/button&gt;
  &lt;button drab-click="My.Other.Commander.add_property('forty-two')"&gt;Add something else&lt;button&gt;
&lt;/div&gt;
</code></pre>
<p>would be equivalent of:</p>
<pre><code>&lt;button drab-click='My.Commander.add_user.add_user({datasource: "Repo.User"})'&gt;Add User&lt;/button&gt;
&lt;button drab-click="My.Other.Commander.add_property('forty-two')"&gt;Add something else&lt;button&gt;
</code></pre>
<p>(notice that exsting properties are not overwritten).</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="70503" 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/drab-remote-controlled-frontend-framework-for-phoenix/3277/297">Post #296</a>
	                </div>
	            </div>
              <div id="likers-container-70503" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="70503"
                     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 #296"></div>
  </section>
</div>
    <div class="postbit" id="70542" data-post-id="70542">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="grych" data-post="296" data-topic="3277">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/grych/48/5610_2.png" class="avatar"> grych:</div>
<blockquote>
<p>Yes, this callbacks are only working with the “main” commander. Noticed to mention about this in docs. If you think all the callbacks from all commanders should be launched, create an issue on github, I will think about it.</p>
</blockquote>
</aside>
<p>Maybe I don’t understand quite who’s able to change what…</p>
<p>I wanted to be able to grab my current_user id from guardian and use put_store(socket, :current_user).  From what’ I’ve read this is using local storage and it is signed and should be tamper proof right?  If that is true I should be able to store it and retrieve it from a shared commander and I don’t need the page_loaded callback.</p>
<p>If not then I suppose I  need to do something with connect in the UserSocket..</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="70542" 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/drab-remote-controlled-frontend-framework-for-phoenix/3277/298">Post #297</a>
	                </div>
	            </div>
              <div id="likers-container-70542" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="70542"
                     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 #297"></div>
  </section>
</div>
    <div class="postbit" id="70614" data-post-id="70614">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="grych" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/grych/120/5610_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  grych
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>Creator of Drab</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I am afraid that <code>get_session/2</code> will not work on the shared commander, unless you whitelist it with <code>access_session</code> macro <strong>in the main commander</strong>. Now I am thinking that it should be changed, all functionality of the “normal” commander should work the same on the shared one.</p>
<p>About the user ID, how do you do socket authentication? If i<a href="https://hexdocs.pm/drab/Drab.Socket.html#module-method-2-use-your-own-connect-2-callback" rel="noopener nofollow ugc">n the connect callback</a>, you may just inject userid to the socket assigns and have an access to it directly.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="70614" 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/drab-remote-controlled-frontend-framework-for-phoenix/3277/299">Post #298</a>
	                </div>
	            </div>
              <div id="likers-container-70614" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="70614"
                     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 #298"></div>
  </section>
</div>
    <div class="postbit" id="70625" data-post-id="70625">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="grych" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/grych/120/5610_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  grych
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>Creator of Drab</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<h2><a name="p-70625-v071-1" class="anchor" href="#p-70625-v071-1" aria-label="Heading link" rel="nofollow"></a>v0.7.1</h2>
<p>This version is a step forward for creating component-like pieces of code with Drab, with enhanced Shared Commanders and possibility to pass additional argument to the handler function.</p>
<p>Finally, most functions got their own <code>@spec</code> and Drab is now dialyzable.</p>
<h3><a name="p-70625-warning-2" class="anchor" href="#p-70625-warning-2" aria-label="Heading link" rel="nofollow"></a>Warning!</h3>
<p><code>Drab.Live</code> cache DETS has changed, please ensure your <code>"*.drab</code> templates are recompiled after the upgrade.</p>
<h3><a name="p-70625-new-features-3" class="anchor" href="#p-70625-new-features-3" aria-label="Heading link" rel="nofollow"></a>New Features</h3>
<h4><a name="p-70625-define-shared-commander-with-drab-commander-on-all-children-nodes-4" class="anchor" href="#p-70625-define-shared-commander-with-drab-commander-on-all-children-nodes-4" aria-label="Heading link" rel="nofollow"></a>Define Shared Commander with <code>drab-commander</code> on all children nodes</h4>
<p>If you add <code>drab-commander</code> attribute to any tag, all children of this tag will use Shared Commander defined in this tag. Notice it will not redefine nodes, which already has Shared Commander defined.</p>
<p>Thus this:</p>
<pre><code>&lt;div drab-commander="DrabExample.SharedCommander"&gt;
  &lt;button drab-click="button1_clicked"&gt;1&lt;/button&gt;
  &lt;button drab-click="button2_clicked"&gt;1&lt;/button&gt;
  &lt;button drab-click="DrabExample.AnotherCommander.button3_clicked"&gt;1&lt;/button&gt;
&lt;/div&gt;
</code></pre>
<p>is equivalent of:</p>
<pre><code>&lt;div&gt;
  &lt;button drab-click="DrabExample.SharedCommander.button1_clicked"&gt;1&lt;/button&gt;
  &lt;button drab-click="DrabExample.SharedCommander.button2_clicked"&gt;1&lt;/button&gt;
  &lt;button drab-click="DrabExample.AnotherCommander.button3_clicked"&gt;1&lt;/button&gt;
&lt;/div&gt;
</code></pre>
<h4><a name="p-70625-additional-argument-for-handlers-5" class="anchor" href="#p-70625-additional-argument-for-handlers-5" aria-label="Heading link" rel="nofollow"></a>Additional argument for handlers</h4>
<p>Since this version you may create handler with arity of 3, and pass the additional parameter using parenthesis after the handler name in <code>drab</code> attribute:</p>
<pre><code>&lt;button drab-click='button_clicked(42)'&gt;
</code></pre>
<p>This will run <code>button_clicked/3</code> instead of <code>button_clicked/2</code> in your Commander:</p>
<pre><code>def button_clicked(socket, sender, the_answer_for_the_ultimate_question)
</code></pre>
<p>The attribute is evaluated on the client side, so it could be any valid JS expression:</p>
<pre><code>&lt;button drab-click='button_clicked({the_answer: 42})'&gt;
&lt;button drab-click='button_clicked(window.location)'&gt;
</code></pre>
<h4><a name="p-70625-drab-argument-6" class="anchor" href="#p-70625-drab-argument-6" aria-label="Heading link" rel="nofollow"></a><code>drab-argument</code></h4>
<p>Analogically to <code>drab-commander</code> attribute, there is a <code>drab-argument</code> to set this argument for more nodes. Notice that the existing arguments are not overwritten, so this:</p>
<pre><code>&lt;div drab-argument='42'&gt;
  &lt;button drab-click='button_clicked'&gt;
  &lt;button drab-click='button_clicked(43)'&gt;
&lt;/div&gt;
</code></pre>
<p>is the equivalent to:</p>
<pre><code>&lt;button drab-click='button_clicked(42)'&gt;
&lt;button drab-click='button_clicked(43)'&gt;
</code></pre>
<h4><a name="p-70625-client-side-errors-now-appears-in-the-application-log-7" class="anchor" href="#p-70625-client-side-errors-now-appears-in-the-application-log-7" aria-label="Heading link" rel="nofollow"></a>Client-side errors now appears in the application log</h4>
<p>For developer happines, all client-side errors are now displayed both on JS console and on the Phoenix side.</p>
<p>Example:</p>
<pre><code>&lt;button drab=":wrong"&gt;
</code></pre>
<p>generates:</p>
<pre><code>[error] Browser reports: Drab attribute value ':wrong' is incorrect.
</code></pre>
<h3><a name="p-70625-bugfixes-8" class="anchor" href="#p-70625-bugfixes-8" aria-label="Heading link" rel="nofollow"></a>Bugfixes</h3>
<ul>
<li>Parent/child expression case in Drab.Live (<span class="hashtag-raw">#71</span>) solved</li>
<li>Updated floki to 0.20; fixed <span class="hashtag-raw">#76</span></li>
<li>Special case for outerHTML in <code>Drab.Element.set_prop</code>, fixed <span class="hashtag-raw">#80</span></li>
<li>Special case for HTMLOptionsCollection; fixed <span class="hashtag-raw">#75</span></li>
</ul> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="70625" 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/drab-remote-controlled-frontend-framework-for-phoenix/3277/300">Post #299</a>
	                </div>
	            </div>
              <div id="likers-container-70625" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="70625"
                     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 #299"></div>
  </section>
</div>
    <div class="postbit" id="70626" data-post-id="70626">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="grych" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/grych/120/5610_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  grych
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>Creator of Drab</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>There are new examples on the demo page:</p>
<ul>
<li><a href="https://tg.pl/drab#argument" rel="noopener nofollow ugc">Passing optional argument to the handler</a></li>
<li><a href="https://tg.pl/drab#shared" rel="noopener nofollow ugc">Using Shared Commanders</a></li>
</ul> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="70626" 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/drab-remote-controlled-frontend-framework-for-phoenix/3277/301">Post #300</a>
	                </div>
	            </div>
              <div id="likers-container-70626" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="70626"
                     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 #300"></div>
  </section>
</div>
</template></turbo-stream><turbo-stream action="replace" target="load-more-container"><template><div id="load-more-container" class="load-more-container">
    <a class="load-more-button" data-turbo-stream="true" href="/topics/3277/load_more?page=31">Load more posts (188 remaining)</a>
</div></template></turbo-stream>