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(ui): reset pagination when typing in WhereBuilder select menu #10551

Merged
merged 1 commit into from
Jan 13, 2025

Conversation

GermanJablo
Copy link
Contributor

@GermanJablo GermanJablo commented Jan 13, 2025

After working on this I found a more accurate way to reproduce the bug:

  • in the issue repro, type a letter in the select menu.
  • delete the letter and wait for the debounce (300ms)
  • type another letter.
  • in devtools, you should see that the query increases the pagination by +1. With this change, the pagination is reset when the input changes.

Fixes #10496

I'd like to do integration testing. But since there is no isolated /ui test yet, this requires some planning. I have it pending.

@jacobsfletch
Copy link
Member

Tests for this could have been written within the Admin > List View e2e test suite under the "filters" describe block. See this file: https://github.com/payloadcms/payload/blob/main/test/admin/e2e/list-view/e2e.spec.ts. Or alternatively under the Fields > Collections > Relationship e2e suite.

Copy link
Contributor

🚀 This is included in version v3.17.0

GermanJablo added a commit that referenced this pull request Jan 20, 2025
…#10553)

Following #10551, I found and
fixed a handful more bugs:

- When writing to the input, the results that were already there were
not cleaned, causing incorrect results to appear.
- the scroll was causing an infinite loop that showed repeated elements
- optimization: only the required field is selected (not required)
- refs are set to the initial value to avoid a state where nothing can
be searched
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.

Filter relationship collections does not show all collections
2 participants