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 state when route to Homepage with asPath = / #98

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

tiendn
Copy link

@tiendn tiendn commented Jul 16, 2024

Description

Currently, when a user performs a search and wants to reset or go back, they must manually clear the text or click the close button.
To improve convenience, clicking on the Hyperlane Logo Header should clear all input text.

How

Add useEffect on MessageSearch.tsx, check when router changed asPath to '/', set reset input in background

@tiendn tiendn requested review from yorhodes and jmrossy as code owners July 16, 2024 05:17
Copy link

vercel bot commented Jul 16, 2024

@tiendn is attempting to deploy a commit to the Abacus Works Team on Vercel.

A member of the Team first needs to authorize it.

@jmrossy
Copy link
Collaborator

jmrossy commented Jul 22, 2024

@tiendn Thanks for the contribution but we feel that the UX benefit is minimal but this change complicates the URL query param management. Currently the logic is handled in useSyncQueryParam but this adds extra logic in the MessageSearch component.

@tiendn
Copy link
Author

tiendn commented Jul 23, 2024

Hm, OK.
I just think it makes the UX more convenient, but if there is extra logic, I’m not sure.
May I ask, what extra logic is there?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants