<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>phx-click on Poeticoding</title><link>https://www.poeticoding.com/tag/phx-click/</link><description>Recent content in phx-click on Poeticoding</description><generator>Hugo</generator><language>en</language><lastBuildDate>Fri, 15 Jan 2021 20:06:30 +0000</lastBuildDate><atom:link href="https://www.poeticoding.com/tag/phx-click/index.xml" rel="self" type="application/rss+xml"/><item><title>LiveView click event and offsetX, offsetY coordinates</title><link>https://www.poeticoding.com/liveview-click-event-and-offsetx-offsety-coordinates/</link><pubDate>Thu, 19 Mar 2020 17:05:47 +0000</pubDate><guid>https://www.poeticoding.com/liveview-click-event-and-offsetx-offsety-coordinates/</guid><description>&lt;p>&lt;a href="https://www.poeticoding.com/how-to-setup-phoenix-liveview/">Phoenix LiveView&lt;/a> plays fantastically well with SVG elements, making really easy to render dynamic images, without writing any JavaScript code.&lt;/p>
&lt;p>There are different &lt;a href="https://hexdocs.pm/phoenix_live_view/Phoenix.LiveView.html#module-bindings" target="_blank" rel="noopener">bindings&lt;/a> we can use to register and react to user interaction, one of these is &lt;code>phx-click&lt;/code>. By adding &lt;code>phx-click=&amp;quot;clicked&amp;quot;&lt;/code> attribute to an element in our LiveView, when user clicks the element, a &lt;code>&amp;quot;clicked&amp;quot;&lt;/code> event is sent to the LiveView process.&lt;/p></description></item></channel></rss>