Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Clear Search when switching between plages #33

Conversation

shrilakshmishastry
Copy link
Member

@shrilakshmishastry shrilakshmishastry commented Apr 17, 2022

Fix for Issue 14: Clear Search when switching between plages

Added the following :

  1. A custom hook named useBackListener to figure out browser 'POP' and 'PUSH' simulation

How does it work now?

  1. Whenever there is 'PUSH' or 'POP', it's captured in the SearchPlay component. Both the Search term and the input field are cleared.
  2. Inside the useEffect of Home component, the search term is set back to an empty string to clear the search.

Links referred

Writing custom hook for browser action

@vercel
Copy link

vercel bot commented Apr 17, 2022

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/atapas/react-play/4FPhTc6Q6YYK4PdtJpkkTgeMTbns
✅ Preview: https://react-play-git-fork-shrilakshmishastry-issue-14-c-a1bc32-atapas.vercel.app

@shrilakshmishastry shrilakshmishastry changed the title fix Clear Search and Filter when switching between plages fix: Clear Search when switching between plages Apr 17, 2022
@atapas
Copy link
Member

atapas commented Apr 17, 2022

Hi @shrilakshmishastry,

Could you please resolve the merge conflicts?

Copy link
Member

@atapas atapas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@shrilakshmishastry We need to handle the changes for filtering as well. Could you please take care of it in the same PR?

src/common/home/Home.jsx Outdated Show resolved Hide resolved
@atapas atapas added bug Something isn't working review ready labels Apr 17, 2022
@atapas atapas linked an issue Apr 19, 2022 that may be closed by this pull request
Copy link
Member

@atapas atapas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks Good

@atapas atapas merged commit 47600c5 into reactplay:main Apr 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

🐛 Clear Search and Filter when switching between pages
2 participants