You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello @StellarLogic! I'm a bot here to help you with bugs, questions, and contributions. Let's work together to solve the issue you're facing.
To resolve the issue where clearing the search bar does not render the whole list of items in the Countries, States, and Cities columns, you need to ensure that the filter function handles the case when the search input is empty. Here is an example of how you can modify the filter function to achieve this:
functionfilter(type){// Declare variablesvarinput,filter,table,tr,td,i,txtValue;input=document.getElementById('search-'+type);filter=input.value.toUpperCase();table=document.getElementById(type);tr=table.getElementsByTagName("tr");// Loop through all table rows, and hide those who don't match the search queryfor(i=0;i<tr.length;i++){td=tr[i].getElementsByTagName("td")[0];if(td){txtValue=td.textContent||td.innerText;if(txtValue.toUpperCase().indexOf(filter)>-1||filter===""){tr[i].style.display="";}else{tr[i].style.display="none";}}}}
In this code, the condition txtValue.toUpperCase().indexOf(filter) > -1 || filter === "" ensures that if the search input is empty (filter === ""), all rows will be displayed. This should resolve the issue of not rendering the whole list of items when the search bar is cleared [1][2].
Clearing search is not rendering the whole list
Steps to reproduce
The text was updated successfully, but these errors were encountered: