Why isn't Popup's Reposition function working?

176
1
01-03-2020 11:53 AM
JackFairfield
Occasional Contributor II

The Popup's reposition function doesn't do anything in this jsbin example with a viewDiv that has a 500px height.

Here's the relevant code I'm using:

view.popup.watch("visible", function(val) {
   if (val) {
      view.popup.reposition();
   }
});

Here's the JSbin example.

0 Kudos
1 Reply
RobertScheitlin__GISP
MVP Esteemed Contributor

Jack,

  To to a more appropriate test of the popups reposition method use this:

      view.watch('stationary', function(){
if(view.popup.visible){
view.popup.reposition();
}
});

If you comment out your

      view.popup.watch("visible", function (val) {
if (val) {
view.popup.reposition();
}
});

and then pan the map you will see the popup repostion method works as intended.