I have this code here where it works perfectly on my local Macbook pro, simulated test as mobile phone in Google Chrome. But when I deploy it, and clicked on the mobile phone itself, no event seems to be detected, it's like it ignore click event completely.
//show age diff
var showAgeDiff = false;
var oldText = $( "#age").text();
var sdt = new Date('');
var difdt = new Date(new Date() - sdt);
var babyAgeToCurrentDate = (difdt.toISOString().slice(0, 4) - 1970) + "Y " + (difdt.getMonth()+1) + "M " + difdt.getDate() + "D";
$("#age, #babyNameMobile").click(function() {
showAgeDiff = !showAgeDiff
if(showAgeDiff){
$( "#age" ).text(babyAgeToCurrentDate);
} else {
$( "#age" ).text(oldText);
}
});
Live View
https://mybabies.app/baby/a4b7efe4-9c2f-4c48-b5b1-cc516a8f027f?code=krR4Mn
Desktop
No issue, works as expected. It change from "~8 weeks"
--> 0Y 3M 1D
Mobile only
If you clicked on the age area, click event will not trigger. It should change from "~8 weeks"
--> 0Y 3M 1D
Disclaimer :
- Android Phone ✅
- iPhone ❌
Comments
Post a Comment