You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using Command + K to search, the modal slows down if no results are found. The “No Results Found” message reloads with every keystroke, making the experience feel sluggish.
Step-by-step reproduction instructions
Open a post
Press Cmd + K
Type something in the search bar
Notice when you reach No search result and continue typing, the search results flicker
Screenshots, screen recording, code snippet
Screen.Recording.2025-02-13.at.4.20.39.PM.mov
Environment info
Gutenberg: 20.2.0
WordPress: 6.7.2
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Yes
Please confirm which theme type you used for testing.
Block
Classic
Hybrid (e.g. classic with theme.json)
Not sure
The text was updated successfully, but these errors were encountered:
The Command.Empty automatically renders when there are no results for the search query, so based on this, removing the conditional checks seems to be a reasonable choice
( Path: packages/commands/node_modules/cmdk/dist/index.d.ts ( Line 204-207 ) )
I don't see this as a bug. The data loads after the network request succeeds, and removing those checks could cause a "no results found" message to appear on slow networks, even when results are available.
The data loads after the network request succeeds, and removing those checks could cause a "no results found" message to appear on slow networks, even when results are available.
Very well pointed out with the slow network request thing 💯
Actually I was trying to optimise the isLoading earlier, but looks like there needs to be more work done for that!
Removing the conditions was an immediate thought, felt like it optimised the behaviour ( as mentioned in the docblock )
It's not a bug, rightly said, but I feel the sluggish behaviour can be improved if we optimise maybe
Description
Discovered while reproducing #55899
When using
Command + K
to search, the modal slows down if no results are found. The “No Results Found” message reloads with every keystroke, making the experience feel sluggish.Step-by-step reproduction instructions
Cmd
+K
No search result
and continue typing, the search results flickerScreenshots, screen recording, code snippet
Screen.Recording.2025-02-13.at.4.20.39.PM.mov
Environment info
Please confirm that you have searched existing issues in the repo.
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Please confirm which theme type you used for testing.
The text was updated successfully, but these errors were encountered: