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.
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
Query and Search blocks: support for Instant Search #63147
Query and Search blocks: support for Instant Search #63147
Changes from all commits
c3fd536
793e330
0159a4a
29b2399
5952a03
f0944db
5a85f98
520629d
b3331d5
f4776db
ce27856
be75444
6fbf19c
7627a35
288603a
03d1be0
1495a42
f249ed3
ca0e697
d2fb6e6
4624655
e7d45bb
68d780e
ed9b908
c63840a
a55194f
73b525b
6583a43
81ba04c
fa14b25
a699ce3
9a4e78f
aaeee09
818bc96
289f583
c55cf31
9f2329b
87f5d00
15fe455
853083b
3b5da50
1996b83
020c638
853bed5
51caf3e
f2e16be
e89fd61
9a0e161
5e00cdb
786f7ba
5a77f22
1c99346
9883d0f
2029d4f
00910e5
370a0c5
1be76e0
4414176
42cdfb1
df73c87
67175ea
60a15f4
b4c3913
2bb439e
1edf044
d070fe5
d023c1d
5e02671
6392614
baa6188
a012780
4c0caee
bd080db
ea01121
66c991a
00a8a8b
dad41ca
68985af
dac2ec1
91863c0
1b7b4bf
3dcf20f
ff1d50b
33fd080
db9ceee
7b326ce
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can include the contents of this block but hide them when there are no posts. That way, the CSS and JS of the inner blocks will be correctly loaded and the blocks will work when the user navigates to a "no results" page in the client.
We can remove this workaround if we finally improve how client-side navigation works before WP 6.8.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, nice. That's a good idea 👍
Can we add this in a follow-up PR though? I feel that it's not essential for the first version of the experimental block.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the Pagination Next block needs this change, I understand that the Pagination Previous block will also need it, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's what I had had thought initially as well but actually it won't 🙂
The
Query Pagination, Next
block has to create a new query to determine if it's on the last page of the results (if it is, then the block shouldn't show anything). We have to pass the search parameter to this new query.In
Query Pagination Previous
, no such new query is created, so it just works out of the box!There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just noticed an edge case:
If you navigate to a page with
?instant-search
param AND a pagination parameter likehttp://gutenberg.local/?instant-search-18=qwponbfv&query-18-page=2
, then thePagination Previous
block shows up although it should not.I'll hold on with fixing this for now though until we make a decision on whether we should go ahead with this PR or the approach in #67181 or #67013.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This appears to be a general issue with the Query Loop block as discussed with @ntsekouras. I've opened an issue in #67748