I am implementing a filter search for my search box, everything works well the array get filtered as i need, but it has a strange behaviour, since the search is almost at the bottom of the page (the scrool is at the bottom too) when i enter a character to search on the searchbox the scrool go up i think th ebehaviour has nothing to do with css, the problem is with my filter function.
I do it this way:
public onSearchChange(nameSearch: string): void {
if (this.myFullArr) {
const search = nameSearch.toLowerCase();
this.myArr = this.myFullArr.filter((element) => {
if (element.Name.toLowerCase().indexOf(search) !== -1) {
return true;
}
return false;
})
}
}
this function is called when my search box change, as you guys can see the myFullArr is the initial contend that is static and doesn't change, since i can't use just the original array because it will change, the myArr is the filtered array.
Any help?
Thanks