Issue:
User has to tap link twice to open it.
Expected behaviour:
After replacing the content, first tap on any link should open a page on new tab.
Current behaviour:
After replacing the content, first tap doesn't open the link. Second tap is required.
Minimal code example:
Insert into any HTML page (5s timeout added for convenience):
<div id="dynamic-content">Content before change</div>
<script>
function timedPassback() {
let content = "<div style='width: 300px; height: 300px; background: olive; color: white; text-align: center; font-size: 2rem'><a href='//stackoverflow.com/'>Content after change</a></div>"
let element = document.getElementById("dynamic-content");
element.innerHTML = content;
}
setTimeout(timedPassback, 5000);
</script>
Example page
https://putzj.github.io/ioschromebug/
Steps to reproduce:
- Open the page containing script in Chrome on iOS
- Make a scrolling gesture (the page doesn't have to scroll)
- Wait for the content to be replaced with olive square
- Click any link on the page
Environment:
iPhone 8
Chrome 107.0.5304.101
iOS 15.2
Debug info:
Can't debug Chrome on iOS. There is no tool that works and allows any remote debugging of this issue (tried it on MacOs, Windows and Ubuntu).
Additional info I doubt it's a feature of Chrome. I already reported it as a bug. I searched the web, didn't find any clues on how to fix it or any workarounds. The issue can be reproduced on 4 different iPhones I have access to.
I'm posting the solution which i picked it from comments to show explicility to everyone. I had a problem same issue and fixed it.