MLH-Fellowship / prep-project-4.1.3

MLH Prep Project for Pod 4.1.3
https://mlh-prep-4-1-3.netlify.app/
MIT License
3 stars 10 forks source link

Add a loader instead of Text #13

Closed PriyaBihani closed 2 years ago

sumana2001 commented 2 years ago

Hey @PriyaBihani @grace-omotoso In the recently deployed version as soon as I am trying to type anything it is starting the preloader and not ending. I am not able to understand what the exact issue is though.

https://user-images.githubusercontent.com/63084088/142400352-db454c69-904b-47a4-90b1-c4c1b85480ae.mov

grace-omotoso commented 2 years ago

@PriyaBihani please, take a look at the issue

saikeshari commented 2 years ago

@sumana2001 Here whenever we start typing in the input, it hits the API, so whenever we will start typing and it will send the first letter as query to API, it wouldn't fetch any results and thus, never setting isLoaded as true. So instead of onChange in the input, we have to make it onSubmit and a submit button beside it.

sumana2001 commented 2 years ago

@saikeshari One small suggestion, let me know what you think about it. Since this loader is cover the entire screen, it looks like the page is getting refreshed. Will it be better if we make this either a preloader or somehow create an effect where only that weather section of the website has a loader effect and not the entire thing? I hope it makes sense

saikeshari commented 2 years ago

Yes it can be done. It will be better actually as we could change the input while loader is there thus, solving the above problem.