Skip to content

Fix autocomplete relationship pagination - #7602

Open
faisalahammad wants to merge 3 commits into
pods-framework:release/3.4.0from
faisalahammad:fix/7383-autocomplete-pagination
Open

Fix autocomplete relationship pagination#7602
faisalahammad wants to merge 3 commits into
pods-framework:release/3.4.0from
faisalahammad:fix/7383-autocomplete-pagination

Conversation

@faisalahammad

Copy link
Copy Markdown
Contributor

Description

Relationship autocomplete fields now support server-side pagination. Results remain limited to 15 per request for performance, while scrolling loads additional matching results. Page values are also clamped correctly so requests beyond page 1 work.

Related GitHub issue(s)

Fixes #7383

Testing instructions

  1. Create or open a custom taxonomy with more than 15 matching terms.
  2. Open a Pods relationship autocomplete field using that taxonomy.
  3. Search for a value that has more than 15 matches.
  4. Scroll to the bottom of the result list.
  5. Confirm additional results load and can be selected.
  6. Confirm searches with no additional results stop loading.

Automated checks:

  • Full Jest suite: 509 passed, 2 skipped.
  • Focused AJAX loader tests: 4 passed.
  • Production build passed.
  • PHP syntax check passed.
  • ESLint was blocked because the repository parent config references missing wordpress config.

Screenshots / screencast

Not included. The change is verified through the testing steps above.

Changelog text for these changes

Bug: Relationship autocomplete fields now load results beyond the first 15 matches through pagination. #7383 (@faisalahammad)

PR checklist

@faisalahammad
faisalahammad changed the base branch from main to release/3.4.0 August 18, 2026 11:01
@faisalahammad

Copy link
Copy Markdown
Contributor Author

AI disclosure: this PR was written with Claude Opus 5 assistance, reviewed and tested by me.

react-select's Async components hand loadOptions a single-use callback:
useAsync stores the pending request and drops any callback whose request
is no longer current (useAsync-*.cjs.dev.js:122-123). Re-invoking a stored
callback to append page 2 therefore never reached the menu, so scrolling
loaded nothing.

Drive the option list ourselves for AJAX relationships using a plain
Select (CreatableSelect when taggable) with onMenuScrollToBottom, keeping
the Async components for the non-AJAX taggable case.
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.

List of results in autocomplete field displays only first 15 items

1 participant