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

Eliminating Redundant Clicks on Submit Button in Article Finder #5626

Conversation

PR4NJ41
Copy link
Contributor

@PR4NJ41 PR4NJ41 commented Feb 6, 2024

What this PR does

This pull request addresses an issue in the Article Finder page, where users were encountering many errors by submitting the search query multiple times. Previously, clicking the submit button more than once would lead to errors.

To resolve this issue, I have implemented a set of conditions that disable the submit button after the user clicks it for the first time. The button remains disabled until the search results for the entered query are fully loaded. Additionally, the button is re-enabled after the query is completed.

This enhancement not only prevents the occurrence of errors associated with multiple submit button clicks but also provides a smoother user experience by ensuring that the button is only active when it is appropriate to initiate a new search.

Preview

Before:

Before.mov

After:

After.mp4

@ragesoss
Copy link
Member

Thanks! Looks like the 'before' video has a problem; it's not rendering for me.

@PR4NJ41
Copy link
Contributor Author

PR4NJ41 commented Feb 12, 2024

@ragesoss Here is the 'before' video.
It happens when user clicks submit button again and again while the spinner is shown.

Reuploaded_before.mp4

@PR4NJ41
Copy link
Contributor Author

PR4NJ41 commented Feb 12, 2024

@ragesoss I am also able to reproduce this on https://outreachdashboard.wmflabs.org/

Screenshot 2024-02-12 at 11 45 21 PM

@PR4NJ41
Copy link
Contributor Author

PR4NJ41 commented Feb 12, 2024

@ragesoss Here is the link of the video in case the preview video still does not renders.

@ragesoss
Copy link
Member

Great, thanks. I'm trying to catch up on PR review and hope to get to it later this week.

@ragesoss
Copy link
Member

It looks like this has a conflict with the PR that I merged that converts ArticleFinder to a functional component.

@PR4NJ41
Copy link
Contributor Author

PR4NJ41 commented Feb 15, 2024

@ragesoss I have fixed merged conflicts. Thank You!

@PR4NJ41
Copy link
Contributor Author

PR4NJ41 commented Feb 15, 2024

@ragesoss I have updated the code

@ragesoss ragesoss merged commit 253217f into WikiEducationFoundation:master Feb 16, 2024
1 check passed
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.

None yet

2 participants