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

Search page re-renders on entering input #2554

Closed
HyperTHD opened this issue Dec 1, 2021 · 2 comments · Fixed by #2565
Closed

Search page re-renders on entering input #2554

HyperTHD opened this issue Dec 1, 2021 · 2 comments · Fixed by #2565
Assignees
Labels
area: nextjs Nextjs related issues type: bug Something isn't working

Comments

@HyperTHD
Copy link
Contributor

HyperTHD commented Dec 1, 2021

What happened:
When entering any text inside the search bar, the search page re-renders and focus is removed from the search bar.

What should have happened:
When entering any text, it should keep focus so that you can continue entering your search text. This is a render issue, most likely a variable/function introduced in one of our recent PRs that caused this issue.

The issue is caused by the removal of the autoFocus property in this recent commit. Without that property, upon entering a character, our onChange event handler will cause a useEffect re-render from our SearchProvider, thus, the search page itself will be rendered again and the search input text field loses focus.

@HyperTHD HyperTHD added type: bug Something isn't working area: elasticsearch Elasticsearch Related issues and pull requests Priority: High and removed area: elasticsearch Elasticsearch Related issues and pull requests labels Dec 1, 2021
@HyperTHD HyperTHD changed the title Search input re-renders on entering input Search page re-renders on entering input Dec 1, 2021
@humphd humphd added the area: nextjs Nextjs related issues label Dec 1, 2021
@humphd humphd mentioned this issue Dec 1, 2021
8 tasks
@drew5494
Copy link
Contributor

drew5494 commented Dec 2, 2021

Can I work on this?

@humphd
Copy link
Contributor

humphd commented Dec 2, 2021

Assigned!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: nextjs Nextjs related issues type: bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants