Hey all, welcome to another post about ArcGIS API for Javascript moving popups off screen on mobile devices!
I've seen a few threads, including this one, and this one, and this one, whose solutions include adjusting CSS and adjusting JavaScript properties, but none of those solutions have worked for my case.
The frustrating part is that it works as expected in Chrome Developer Tools (below)

But it doesn't work on my mobile device!
This is a screenshot of the current behavior from my mobile device using Google Chrome.

It seems to be docked in the lower-right corner since when I pan around the view, the pop-up stays put.
Of the suggested fixes, I tried the following:
dockEnabled:false,
dockOptions:{
buttonEnabled: false,
breakpoint: true,
position: "bottom-center"
}
and, even though I think dockEnabled:true will nullify the breakpoint behavior, I tried:
dockEnabled:true,
dockOptions:{
buttonEnabled: false,
breakpoint: true,
position: "bottom-center"
}
I tried adjusting CSS by setting
.esri-popup__main-container esri-widget esri-popup--shadow {
width:100%
}
but that was really just a desperate shot in the dark. I', not sure what other CSS I could adjust as there is no container set on the popup.
My app is broken apart into separate HTML, CSS, JS so pasting the entire code is a bit tricky, but here is my JS to create the view and the popup, where everyLayer is an array of my map layers. There may be some sweet spot between adjusting dockEnabled, dockOptions, etc, but this is what I currently am trying :
view = new MapView({
container: "viewDiv",
map: hybrid,
zoom: 14,
center: [-122.068564,36.999662],
layerViews:everyLayer,
popup:{
highlightEnabled: true,
dockEnabled: true,
dockOptions: {
buttonEnabled: false,
breakpoint: false,
position:"bottom-center"
}
}
})
From all my research, I'm guessing the solution is somewhere in the one or a few of the following:
- override default CSS
- attach popup after I create the view, not at the same time
- update Chrome/Safari on my mobile device
- adjust dockOptions/dockEnabled
Any thoughts anyone may have would be greatly appreciated, especially the wizard of ArcGIS API for JS Robert Scheitlin, GISP.
I'm happy to provide any more information that could help,
Thanks,