<?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 How to manually adjust z-index of popups? (4.30) in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-manually-adjust-z-index-of-popups-4-30/m-p/1581618#M86455</link>
    <description>&lt;P&gt;I want to adjust the z-index of my pop-ups so that they appear above other elements in my web application. I have tried getting the container HTML element and setting it's z-index to an appropriate number, but this does not work. I have also tried using this element's child elements (the actual popup elements, such as .esri-popup__main-container) and manually setting those z-indices with the !important property, but to no avail. Is there a way to fix this issue?&lt;/P&gt;&lt;P&gt;I apologize for the lack of a code snippet, my organization is strict with sharing screenshots/code for applications in development.&lt;/P&gt;</description>
    <pubDate>Tue, 04 Feb 2025 02:22:33 GMT</pubDate>
    <dc:creator>janzagar_0</dc:creator>
    <dc:date>2025-02-04T02:22:33Z</dc:date>
    <item>
      <title>How to manually adjust z-index of popups? (4.30)</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-manually-adjust-z-index-of-popups-4-30/m-p/1581618#M86455</link>
      <description>&lt;P&gt;I want to adjust the z-index of my pop-ups so that they appear above other elements in my web application. I have tried getting the container HTML element and setting it's z-index to an appropriate number, but this does not work. I have also tried using this element's child elements (the actual popup elements, such as .esri-popup__main-container) and manually setting those z-indices with the !important property, but to no avail. Is there a way to fix this issue?&lt;/P&gt;&lt;P&gt;I apologize for the lack of a code snippet, my organization is strict with sharing screenshots/code for applications in development.&lt;/P&gt;</description>
      <pubDate>Tue, 04 Feb 2025 02:22:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-manually-adjust-z-index-of-popups-4-30/m-p/1581618#M86455</guid>
      <dc:creator>janzagar_0</dc:creator>
      <dc:date>2025-02-04T02:22:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to manually adjust z-index of popups? (4.30)</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-manually-adjust-z-index-of-popups-4-30/m-p/1588465#M86557</link>
      <description>&lt;P&gt;To adjust the z-index of pop-ups in ArcGIS Maps SDK for JavaScript, you should be able to control their stacking order by manipulating the pop-up's container or popup elements directly through CSS, but since you're having difficulty with the z-index, there are a few more targeted approaches to ensure that the pop-up appears above other elements on your page.&lt;/P&gt;&lt;P&gt;Here are a few strategies that might resolve your issue:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;STRONG&gt;Accessing the Popup Container and Setting z-index&lt;/STRONG&gt;&lt;P&gt;ArcGIS pop-ups are rendered in a div element with a class like .esri-popup__main-container. You can try targeting the pop-up container with JavaScript after the pop-up is displayed. You’ll want to ensure you're doing this after the pop-up is fully rendered (which can sometimes be tricky if you try to set it before).&lt;/P&gt;&lt;P&gt;Here's how you can adjust the z-index dynamically:&lt;/P&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;view.on("popup-open", function(event) {
  const popup = view.popup;
  const popupElement = popup.container;
  popupElement.style.zIndex = '9999';  // Set a high z-index value
});&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;STRONG&gt;Use !important in CSS to Override Other Styles&lt;BR /&gt;&lt;/STRONG&gt;If you're targeting the pop-up container using CSS and still having issues, try using !important in your CSS selectors. For example:&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;.esri-popup__main-container {
  z-index: 9999 !important;
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;STRONG&gt;Ensure Pop-Up is Not Overridden by Parent Elements&lt;BR /&gt;&lt;/STRONG&gt;Sometimes the parent elements of the pop-up container may have &lt;STRONG&gt;z-index&lt;/STRONG&gt; properties that affect its visibility. In this case, you can adjust the &lt;STRONG&gt;z-index&lt;/STRONG&gt; of the parent containers as well. For example:&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;.esri-popup {
  position: relative;
  z-index: 9999 !important;
}

.esri-popup__main-container {
  z-index: 10000 !important;
}​&lt;/LI-CODE&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;STRONG&gt;&lt;STRONG&gt;Adjusting Z-Index Dynamically Based on the View&lt;BR /&gt;&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;P&gt;If you're having trouble with the z-index in a more complex scenario, consider adjusting the z-index dynamically based on when the pop-up is visible. For example, when the pop-up is open, adjust the stacking context of other elements to ensure it's on top.&lt;/P&gt;&lt;P&gt;Here's an example to dynamically set the z-index after a pop-up opens:&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;view.on("popup-open", function() {
  const popup = view.popup;
  const popupMainContainer = popup.container.querySelector(".esri-popup__main-container");
  if (popupMainContainer) {
    popupMainContainer.style.zIndex = '9999'; // Or any value higher than the other elements
  }
});​&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;STRONG&gt;&lt;STRONG&gt;Setting z-index for the Pop-up's Background&lt;BR /&gt;&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;P&gt;If you're having trouble with the backdrop of the pop-up (the dark background that appears when the pop-up is open), you can also adjust the z-index of the backdrop. Here's how:&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;view.popup.on("open", function() {
  const backdrop = document.querySelector(".esri-popup__overlay");
  if (backdrop) {
    backdrop.style.zIndex = "9998"; // Adjust as needed
  }
});​&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;STRONG&gt;Testing with Different Browser and Inspecting Styles&lt;BR /&gt;&lt;/STRONG&gt;Make sure you check the pop-up using your browser’s developer tools (Inspect Element) to see if any other styles are overriding your changes. Sometimes, browser defaults can lead to unexpected stacking behavior. The z-index should work, but it might need to be adjusted at multiple levels, such as the pop-up container, backdrop, and parent elements.&lt;/LI&gt;&lt;/UL&gt;</description>
      <pubDate>Mon, 24 Feb 2025 11:11:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-manually-adjust-z-index-of-popups-4-30/m-p/1588465#M86557</guid>
      <dc:creator>nafizpervez</dc:creator>
      <dc:date>2025-02-24T11:11:31Z</dc:date>
    </item>
  </channel>
</rss>

