Eric Bulters wrote:
I found the issue.
On first load the stop prop fired to soon and the .pac-container didn't exist yet.
After the initial load the .pac-container stayed in the dom and everytime the screen was loaded a new one was added causing the stop prop to fire on the wrong element.
I added some JS to the OnDestroy of the PlacesAutoComplete webblock to remove the pac-container
if( document.getElementsByClassName('pac-container').length > 1) $('.pac-container').remove();
and I added a check to InitAutoComplete to verify that there was a pac-container
// need to stop prop of the touchend event
if (navigator.userAgent.match(/(iPad|iPhone|iPod)/g)) {
stopprop();
}
...
...
function stopprop(){
console.log(document.getElementsByClassName('pac-container').length > 0);
setTimeout(function() {
if(document.getElementsByClassName('pac-container').length > 0){
var container = document.getElementsByClassName('pac-container')[0];
container.addEventListener('touchend', function(e) {e.stopImmediatePropagation();});
} else {stopprop();}
}, 500);
}
Hello Eric,
I also went through this problem and looking for some tips about it, i found your thread here. I tried to apply your patch but it didn't work for me, I 'm running an iPhone 6 Plus with iOS 12.4.2 and couldn't make it work.
The solution that I found was putting the $('.pac-container').remove();
before the try, on the initAutoComplete JS.
Hope this helps anyone having this issue.
Regards,
Lucas Vilela