Whenever this error occurs, I find myself unable to perform any activities on that page. The only solution is to close the tab and open a new one.
My current code allows me to navigate through an array list (Next and Previous) using array indexing:
Eg:
NextClicked(){
this.spinner.show('priority');
let CurrentArray : any;
this.buttonClicked = true
this.bindStaff = false;
this.NextClickCalled =true;
console.log("======Next Clicked=====")
let CurrentArrayElement = this.modelProject.ID
console.log(CurrentArrayElement)
CurrentArray = JSON.parse(localStorage.getItem('CurrentProjectPageRecords'));
console.log(CurrentArray);
let CurrIndex = CurrentArray.findIndex(x => x.ID === this.modelProject.ID);
CurrIndex = CurrIndex+1
let NextID = CurrentArray[CurrIndex].ID
this.router.navigate(['/projects/' + NextID +'/edit/'+this.projectType]);
}
Clicking "Next" repeatedly and then trying to go back by clicking "Previous" seems to cause the issue. If I click "Next" five times and then try to click "Previous," the page freezes and displays the aforementioned browser warning.
PreviousClicked(){
this.spinner.show('priority');
let CurrentArray : any;
this.buttonClicked = true
this.bindStaff = false;
this.NextClickCalled =true;
console.log("======Previous Clicked=====")
let CurrentArrayElement = this.modelProject.ID
console.log(CurrentArrayElement)
CurrentArray = JSON.parse(localStorage.getItem('CurrentProjectPageRecords'));
console.log(CurrentArray);
let CurrIndex = CurrentArray.findIndex(x => x.ID === this.modelProject.ID);
CurrIndex = CurrIndex-1
let NextID = CurrentArray[CurrIndex].ID
this.router.navigate(['/projects/' + NextID +'/edit/'+this.projectType]);
}
I'm not entirely sure if this is the exact cause of the issue, but consistently performing this activity leads to the warning message mentioned above.