catherineisonline / rest-countries

🌎 REST Countries: A project that interacts with API to provide an in-depth look at different countries. With a color theme switcher feature and the ability to filter and search, you can easily navigate and discover new information.
https://restful-countries.vercel.app/
MIT License
26 stars 5 forks source link

BUG: not refreshing results by correcting a search with no results #10

Closed stefanobini99 closed 5 months ago

stefanobini99 commented 5 months ago

When correcting a string search that produces no results the page is not updated as expected.

Tested with:

Steps to reproduce the error:

  1. Filter countries using a string that for sure does not provide any results ("rits" or "ritaa" should be valid)
  2. While typing results are filtered correctly, and ultimately a blank page is shown
  3. Remove one single character from the string used for filtering out the results.
  4. A blank page, this time with the words "No countries found..." is shown

Will not open another issue because is closely to this but keep in mind that the first time that the search does not produces any results it will be shown a blank page without any text, adding one or more character to that search string will produce the blank page with the text "No countries found...". Steps to reproduce this last:

  1. Filter the countries by typing "rita"
  2. The correct page with filtered results is shown
  3. Add a single character to the string search
  4. The blank page is shown (without any text)
  5. Repeat the point 3 as many times as you want and you can see that it will be shown the blank page with the text "No countries found..."
catherineisonline commented 5 months ago

I checked the first scenario and it works on my side. There is no blank page when using a string that for sure does not provide any results and the page is not completely blank. In the second scenario, everything works as well.

Screenshot 2024-05-15 at 16 11 53

I also didn't understand this scenario: "Repeat the point 3 as many times as you want and you can see that it will be shown the blank page with the text "No countries found..."" The point 3 says to add a single character (for the first try, it assumes you wrote the current one e.g. "rita" and added one more "a", so it's "ritaa". Then you say to repeat it, do you mean to repeat it like keep adding "a"-s or go back to the starting point and then add a character again?

In any case, none of the scenarios showed me any bugs.

stefanobini99 commented 5 months ago

Hi, actually i just notice that I am using the link in your README which is https://catherineisonline.github.io/rest-countries/ however using the other link (https://restful-countries.vercel.app/) i do not encounter the problem. I therefore have to use the latter?

The bug is showing only here: https://catherineisonline.github.io/rest-countries/ For the point 5 I was meaning that once you set the text to "ritaa" you can add any character you want and you will correctly get the page with the text "No countries found..."

catherineisonline commented 3 months ago

Hi, actually i just notice that I am using the link in your README which is https://catherineisonline.github.io/rest-countries/ however using the other link (https://restful-countries.vercel.app/) i do not encounter the problem. I therefore have to use the latter?

The bug is showing only here: https://catherineisonline.github.io/rest-countries/ For the point 5 I was meaning that once you set the text to "ritaa" you can add any character you want and you will correctly get the page with the text "No countries found..."

I don't remember to be honest why I have both links active but I will fix that now and switch to Vercel only.