Ok my app is working so far.
When i press cancle on a item page it goes back to my list page . thats the expected behaviour.
now if i doubleclick the cancelbutton , the second click is detected in the list page right when it loads , and then goes directly back to the item page but without loading the script though!!!
then im stuck in that page, and cant do anything anymore
this is a pretty serious bug, anybody know s a solution or workaround for this ?
maybe delaying the load of the page? overlaying an unclickable element for a second? , disable all click events for a second ?
something like that ?
EDIT:
i solved this through a hack , to disable the click listenener for a second after it enters view
ionViewWillLeave() {
let monitorList = document.getElementById("monitors-list");
monitorList.style.pointerEvents = "none";
}
ionViewDidEnter() {
let monitorList = document.getElementById("monitors-list");
setTimeout(function(){ monitorList.style.pointerEvents = "auto"; }, 1000);
}
its a quick hack but it prevents that error at least … maybe it can help someone with the same problem
EDIT2:
hmm this sometimes works and sometimes not , the first 2 back n forths are compromised , seems to be some crazy racecondition or whatever,
EDIT3:
to prevent/bridge the first 2 seconds of this hack not working just add
style= “pointer-events: none;”
to the element style , that makes you page for the first 2 seconds (scrolling and everything works but not clicking )
I would urge you to take a deep breath and fix whatever the underlying race condition is, instead of scrambling around trying to block events temporarily, because it is extremely unlikely that you will come up with something that works consistently in a variety of environments.
i dont think i can fix it …theres no way to debug it either since its a random condition of enter and exit … there should actually be no reason why the page doesnt load correctly.
since it doesnt even load any code theres no error messages on the debug console either
Are you using a framework? Is the project written in TypeScript?
its the ionic5 cli angular , and i test the app directly on my phone.
In that case, if you’re willing to put together a publicly-accessible MCVE on GitHub or Gitlab, maybe we can figure it out.
i think i could do that but will take some days, i need to do other stuff first … ill then upload a mcve of my projects src folder i guess