Feature: Improve select components #642
Merged
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.
This PR changes how the posts selects works.
This affects Query loop "Parent", "Exclude Parent", "Include posts", "Exclude posts" and Dynamic data "Select source post".
There's the possibility to add pagination upon scroll, but we are limited by the API. We can, for example, increase the page number on each scroll fetching more posts, but the API does not support to make request with a number larger the the actual "page" count, so its required to us to know before hand how many pages the request has.
Currently, the only way to know the number of total pages on request is checking the "Header" of the request, but the core hooks seems to not have a way for us to use that information. Using our own implementation of fetching posts was also an option and could solve the pagination problem, but would require us to implement state caching so we don't re-fetch same requests many times thus requiring much more work than expected.
After testing, if everything is working fine as supposed to we must replicate this changes to all Terms selects.