<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Stop Propagation in React JS Custom Visuals in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Stop-Propagation-in-React-JS-Custom-Visuals/m-p/1494806#M26468</link>
    <description>&lt;P&gt;Hi all,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I&amp;nbsp;have successfully built a custom visual using the React JS, following this tutorial (&lt;A href="https://docs.microsoft.com/pt-br/power-bi/developer/visuals/create-react-visual" target="_blank"&gt;https://docs.microsoft.com/pt-br/power-bi/developer/visuals/create-react-visual&lt;/A&gt;) &amp;nbsp;and everything is working fine except the Event StopPropagation,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I developted a Table in React using the Material UI, everything ok, but in the event click (onClick props), im calling that function&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;    selectionManager
      .select(selected.identity, false)
      .then((ids: powerbi.visuals.ISelectionId[]) =&amp;gt; {
        console.log("IdsSelecao", ids);
        this.syncSelectionState(selected);
      });

    event.preventDefault();
    event.stopPropagation();&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the syncSelectionState there are setState, which one call the render, its ok, but there are another unexpected render, calling the update method in the visual.ts&amp;nbsp;consequently , thats render my components again...&lt;BR /&gt;Using the d3, this behavior is&amp;nbsp; treated using this&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;        this.selectionManager
            .select(event.identity, true)
            .then((ids: ISelectionId[]) =&amp;gt; {
                this.syncSelectionState(this.barSelection, ids, event.identity);
            });
        (&amp;lt;Event&amp;gt;d3.event).stopPropagation();&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need help to fix that, why doesnt&amp;nbsp; stopPropagation work? Ive tryiing use&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;event&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;nativeEvent&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;stopImmediatePropagation() but without sucess&lt;BR /&gt;&lt;BR /&gt;Gabriel.&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Sun, 15 Nov 2020 21:18:34 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2020-11-15T21:18:34Z</dc:date>
    <item>
      <title>Stop Propagation in React JS Custom Visuals</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Stop-Propagation-in-React-JS-Custom-Visuals/m-p/1494806#M26468</link>
      <description>&lt;P&gt;Hi all,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I&amp;nbsp;have successfully built a custom visual using the React JS, following this tutorial (&lt;A href="https://docs.microsoft.com/pt-br/power-bi/developer/visuals/create-react-visual" target="_blank"&gt;https://docs.microsoft.com/pt-br/power-bi/developer/visuals/create-react-visual&lt;/A&gt;) &amp;nbsp;and everything is working fine except the Event StopPropagation,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I developted a Table in React using the Material UI, everything ok, but in the event click (onClick props), im calling that function&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;    selectionManager
      .select(selected.identity, false)
      .then((ids: powerbi.visuals.ISelectionId[]) =&amp;gt; {
        console.log("IdsSelecao", ids);
        this.syncSelectionState(selected);
      });

    event.preventDefault();
    event.stopPropagation();&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the syncSelectionState there are setState, which one call the render, its ok, but there are another unexpected render, calling the update method in the visual.ts&amp;nbsp;consequently , thats render my components again...&lt;BR /&gt;Using the d3, this behavior is&amp;nbsp; treated using this&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;        this.selectionManager
            .select(event.identity, true)
            .then((ids: ISelectionId[]) =&amp;gt; {
                this.syncSelectionState(this.barSelection, ids, event.identity);
            });
        (&amp;lt;Event&amp;gt;d3.event).stopPropagation();&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need help to fix that, why doesnt&amp;nbsp; stopPropagation work? Ive tryiing use&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;event&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;nativeEvent&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;stopImmediatePropagation() but without sucess&lt;BR /&gt;&lt;BR /&gt;Gabriel.&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Sun, 15 Nov 2020 21:18:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Stop-Propagation-in-React-JS-Custom-Visuals/m-p/1494806#M26468</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-11-15T21:18:34Z</dc:date>
    </item>
    <item>
      <title>Re: Stop Propagation in React JS Custom Visuals</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Stop-Propagation-in-React-JS-Custom-Visuals/m-p/1514782#M26591</link>
      <description>&lt;P&gt;Anybody? I have no ideia to solve that&lt;/P&gt;</description>
      <pubDate>Wed, 25 Nov 2020 00:12:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Stop-Propagation-in-React-JS-Custom-Visuals/m-p/1514782#M26591</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-11-25T00:12:57Z</dc:date>
    </item>
  </channel>
</rss>

