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 comment widget and autosuggest request #2257

Merged
merged 2 commits into from
Jul 6, 2021
Merged

Conversation

Rahmon
Copy link
Contributor

@Rahmon Rahmon commented Jul 6, 2021

Description of the Change

This change moves the debounce functions outside of keyup event to avoid that a new reference is created and lost the previous one. If not, the same request is sent to the server to fetch the results.

Alternate Designs

Benefits

Possible Drawbacks

Verification Process

  1. Add the Elasticpress - Comments widget
  2. Type e.g. "dol" (there is a delay of 500 milliseconds)
  3. Check if just one request is sent to retrieve the comments.

For Autosuggest, the delay is 200 ms.

Checklist:

  • I have read the CONTRIBUTING document.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my change.
  • All new and existing tests passed.

Applicable Issues

Changelog Entry

@Rahmon Rahmon merged commit 01f1c4c into develop Jul 6, 2021
@Rahmon Rahmon deleted the fix/comment-widget-search branch July 6, 2021 22:16
felipeelia added a commit that referenced this pull request Jul 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants