<?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 Re: DOM element can not be queried by querySelector after added into to MapView.ui in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/dom-element-can-not-be-queried-by-queryselector/m-p/1666547#M87889</link>
    <description>&lt;P&gt;See this answer here:&amp;nbsp;&lt;A href="https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/componentonready-of-legend-map-componenet-was-not/m-p/1666543/highlight/true#M87887" target="_blank"&gt;https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/componentonready-of-legend-map-componenet-was-not/m-p/1666543/highlight/true#M87887&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can review the components patterns guide for more assistance.&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/programming-patterns/" target="_blank" rel="noopener"&gt;https://developers.arcgis.com/javascript/latest/programming-patterns/&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 17 Nov 2025 23:13:40 GMT</pubDate>
    <dc:creator>ReneRubalcava</dc:creator>
    <dc:date>2025-11-17T23:13:40Z</dc:date>
    <item>
      <title>DOM element can not be queried by querySelector after added into to MapView.ui with v4.34</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/dom-element-can-not-be-queried-by-queryselector/m-p/1666394#M87882</link>
      <description>&lt;P&gt;In JS API v4.34, I'm trying to add DOM element to the map view MapView.ui.add().&lt;/P&gt;&lt;P&gt;The element is added to the map slot (used to be position)&amp;nbsp; correctly, however, when I tried to use querySelector to look for it by id or class name, querySelector wouldn't be able to find it in from the root document and returns null.&lt;/P&gt;&lt;P&gt;I also observed that style definition define in the css file on the same id or class name would not apply either.&lt;/P&gt;&lt;P&gt;Here is a sample code&lt;/P&gt;&lt;P&gt;js script&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;//When using v4.34
 let infoPanel = document.createElement('DIV');
 infoPanel.className = 'infoPanel border';
 infoPanel.innerHTML = 'Info Panel';
 infoPanel.style.borderWidth = '1px';
 infoPanel.style.borderColor = 'blue';
 infoPanel.style.borderStyle = 'solid';

 let arcgisMap = document.querySelector('arcgis-map');
 arcgisMap.view.ui.add(infoPanel, 'top-right');
 // a element would be added to the top-right corner of the map with text 'Info Panel' enclosed by a blue border with squared corners and transparent background

 console.log(document.querySelector('arcgis-map')) //console print out null&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;css file&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;.infoPanel, #panelHeader {
    background-color: white;
    border-radius: 0.5rem 0.5rem 0rem 0rem;
} /* this is suppose to modify the element with corned top corners and a white background. But these styles was not reflected by the generated element by the JS script */&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is this a bug? This code worked properly in v4.33&lt;/P&gt;</description>
      <pubDate>Tue, 18 Nov 2025 14:30:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/dom-element-can-not-be-queried-by-queryselector/m-p/1666394#M87882</guid>
      <dc:creator>AllenHuang</dc:creator>
      <dc:date>2025-11-18T14:30:21Z</dc:date>
    </item>
    <item>
      <title>Re: DOM element can not be queried by querySelector after added into to MapView.ui</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/dom-element-can-not-be-queried-by-queryselector/m-p/1666547#M87889</link>
      <description>&lt;P&gt;See this answer here:&amp;nbsp;&lt;A href="https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/componentonready-of-legend-map-componenet-was-not/m-p/1666543/highlight/true#M87887" target="_blank"&gt;https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/componentonready-of-legend-map-componenet-was-not/m-p/1666543/highlight/true#M87887&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can review the components patterns guide for more assistance.&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/programming-patterns/" target="_blank" rel="noopener"&gt;https://developers.arcgis.com/javascript/latest/programming-patterns/&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Nov 2025 23:13:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/dom-element-can-not-be-queried-by-queryselector/m-p/1666547#M87889</guid>
      <dc:creator>ReneRubalcava</dc:creator>
      <dc:date>2025-11-17T23:13:40Z</dc:date>
    </item>
    <item>
      <title>Re: DOM element can not be queried by querySelector after added into to MapView.ui with v4.34</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/dom-element-can-not-be-queried-by-queryselector/m-p/1673546#M87977</link>
      <description>&lt;P&gt;Instead of defining a class for the div element, you can try setting the "part" attribute, which will be available as a selector for your CSS.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;infoPanel.setAttribute("part", "infoPanel border")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then in the CSS:&lt;/P&gt;&lt;LI-CODE lang="css"&gt;*::part(infoPanel) {
    background-color: white;
    border-radius: 0.5rem 0.5rem 0rem 0rem;
} &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Dec 2025 09:55:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/dom-element-can-not-be-queried-by-queryselector/m-p/1673546#M87977</guid>
      <dc:creator>FC_Basson</dc:creator>
      <dc:date>2025-12-17T09:55:25Z</dc:date>
    </item>
  </channel>
</rss>

