I have a script to grab the pop-up information when opened from the search bar. Only I get null results for the first opened pop-up and it's driving me crazy.
The second time a pop up everything works as expected. I just can't capture the first pop up to open.
If there is a better way to know which pop up is opened, I would love to know.
Solved! Go to Solution.
If you put in a timeout, then it does work properly on the first popup
view.popup.watch("visible", function (popUpStatusChange) {
setTimeout(function(){
if (popUpStatusChange == true) {
console.log('Pop-up watch has been fired')
console.log("Pop-up title is:", view.popup.title); //returns the pop up title
console.log("Pop-up content is:", view.popup.content); //returns the pop up content
}
}, 100);
});
If you put in a timeout, then it does work properly on the first popup
view.popup.watch("visible", function (popUpStatusChange) {
setTimeout(function(){
if (popUpStatusChange == true) {
console.log('Pop-up watch has been fired')
console.log("Pop-up title is:", view.popup.title); //returns the pop up title
console.log("Pop-up content is:", view.popup.content); //returns the pop up content
}
}, 100);
});