<?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 4.23 renderPreviewHTML issue in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/4-23-renderpreviewhtml-issue/m-p/1165783#M77051</link>
    <description>&lt;P&gt;Not listed in the breaking changes for the 4.23 release is that svg elements generated by the &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-support-symbolUtils.html" target="_self"&gt;symbolUtils&lt;/A&gt;. &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-support-symbolUtils.html#renderPreviewHTML" target="_self"&gt;renderPreviewHTML&lt;/A&gt; function now have their css display explicitly set to “block”. Previously this property was not set, and defaulted to the value of “inline”.&lt;/P&gt;&lt;P&gt;As can be seen in the image below, this makes a substantial difference in how they’re laid out on the page, which the browser's Developer Tools help show:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="4.22 vs 4.23" style="width: 769px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/39340i42EAD3F038CBCE8C/image-size/large?v=v2&amp;amp;px=999" role="button" title="423_svg_block.png" alt="4.22 vs 4.23" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;4.22 vs 4.23&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;This image shows a custom symbol selector that allows a user to visually specify the value for a field associated with a &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html" target="_self"&gt;UniqueValueRenderer&lt;/A&gt; when specifying a feature’s attributes. It uses a simple table where each cell is supposed to be center-aligned, but changes made to 4.23 throw it off.&lt;/P&gt;&lt;P&gt;I can’t think of a good reason why every image generated by renderPreviewHTML should be displayed as a block. If we wanted to do something as unusual as that, we could do it ourselves by wrapping it in a div, or better yet, adding our own CSS selectors. To get around this now, though, we either have to add application logic to set it back to inline, or add a CSS selector with an “!important” rule, neither of which is desirable.&lt;/P&gt;&lt;P&gt;Since we host a local copy of the JSAPI, I prefer just to prevent the addition altogether. The following shows how to do this for AMD-based solutions. Although the issue is found within the esri/symbols/support/svgUtils module, we made the change in the esri/widgets/Legend.js file since we use the Legend widget and it already contains a copy of that module.&lt;/P&gt;&lt;P&gt;In esri/widgets/Legend.js, search for:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;{xmlns:"http://www.w3.org/2000/svg",width:C,height:G,style:"display: block;"}&lt;/LI-CODE&gt;&lt;P&gt;Replace with:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;{xmlns:"http://www.w3.org/2000/svg",width:C,height:G/*,style:"display: block;"*/}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 19 Apr 2022 18:07:53 GMT</pubDate>
    <dc:creator>JoelBennett</dc:creator>
    <dc:date>2022-04-19T18:07:53Z</dc:date>
    <item>
      <title>4.23 renderPreviewHTML issue</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/4-23-renderpreviewhtml-issue/m-p/1165783#M77051</link>
      <description>&lt;P&gt;Not listed in the breaking changes for the 4.23 release is that svg elements generated by the &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-support-symbolUtils.html" target="_self"&gt;symbolUtils&lt;/A&gt;. &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-support-symbolUtils.html#renderPreviewHTML" target="_self"&gt;renderPreviewHTML&lt;/A&gt; function now have their css display explicitly set to “block”. Previously this property was not set, and defaulted to the value of “inline”.&lt;/P&gt;&lt;P&gt;As can be seen in the image below, this makes a substantial difference in how they’re laid out on the page, which the browser's Developer Tools help show:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="4.22 vs 4.23" style="width: 769px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/39340i42EAD3F038CBCE8C/image-size/large?v=v2&amp;amp;px=999" role="button" title="423_svg_block.png" alt="4.22 vs 4.23" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;4.22 vs 4.23&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;This image shows a custom symbol selector that allows a user to visually specify the value for a field associated with a &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-UniqueValueRenderer.html" target="_self"&gt;UniqueValueRenderer&lt;/A&gt; when specifying a feature’s attributes. It uses a simple table where each cell is supposed to be center-aligned, but changes made to 4.23 throw it off.&lt;/P&gt;&lt;P&gt;I can’t think of a good reason why every image generated by renderPreviewHTML should be displayed as a block. If we wanted to do something as unusual as that, we could do it ourselves by wrapping it in a div, or better yet, adding our own CSS selectors. To get around this now, though, we either have to add application logic to set it back to inline, or add a CSS selector with an “!important” rule, neither of which is desirable.&lt;/P&gt;&lt;P&gt;Since we host a local copy of the JSAPI, I prefer just to prevent the addition altogether. The following shows how to do this for AMD-based solutions. Although the issue is found within the esri/symbols/support/svgUtils module, we made the change in the esri/widgets/Legend.js file since we use the Legend widget and it already contains a copy of that module.&lt;/P&gt;&lt;P&gt;In esri/widgets/Legend.js, search for:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;{xmlns:"http://www.w3.org/2000/svg",width:C,height:G,style:"display: block;"}&lt;/LI-CODE&gt;&lt;P&gt;Replace with:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;{xmlns:"http://www.w3.org/2000/svg",width:C,height:G/*,style:"display: block;"*/}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Apr 2022 18:07:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/4-23-renderpreviewhtml-issue/m-p/1165783#M77051</guid>
      <dc:creator>JoelBennett</dc:creator>
      <dc:date>2022-04-19T18:07:53Z</dc:date>
    </item>
    <item>
      <title>Re: 4.23 renderPreviewHTML issue</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/4-23-renderpreviewhtml-issue/m-p/1188826#M77830</link>
      <description>&lt;P&gt;I noticed this too.&amp;nbsp; It made my custom TOC look weird.&amp;nbsp; I used your suggestion and set !important to all svg in css and that did the trick.&amp;nbsp; Thank you!&lt;/P&gt;</description>
      <pubDate>Fri, 01 Jul 2022 17:30:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/4-23-renderpreviewhtml-issue/m-p/1188826#M77830</guid>
      <dc:creator>DanielWebb</dc:creator>
      <dc:date>2022-07-01T17:30:38Z</dc:date>
    </item>
  </channel>
</rss>

