Fix autocomplete relationship pagination - #7602
Open
faisalahammad wants to merge 3 commits into
Open
Conversation
faisalahammad
requested review from
JoryHogeveen and
sc0ttkclark
as code owners
August 10, 2026 20:12
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
Automated checks:
wordpressconfig.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