Skip to content
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

Enhance Search Block with Live Results Dropdown #69755

Open
wants to merge 2 commits into
base: trunk
Choose a base branch
from

Conversation

sarthaknagoshe2002
Copy link
Contributor

What?

This PR enhances the search block by introducing a live results dropdown.
Closes #62421

Why?

Currently, WordPress search lacks real-time feedback while typing. This feature improves the user experience by:

  • Allowing quick preview of search results without leaving the page.
  • Reducing search errors by guiding users toward relevant queries.

How?

Live Search Results Dropdown:

  • Fetches and displays a small sample of actual results as the user types.

Testing Instructions

  1. Add the Search Block to a page.
  2. Start typing in the search box and verify:
  3. The dropdown displays live search results based on the query.

Screenshots or screencast

Screen.Recording.2025-03-29.at.10.31.22.PM.mov

Copy link

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: sarthaknagoshe2002 <[email protected]>
Co-authored-by: cbirdsong <[email protected]>
Co-authored-by: bhubbard <[email protected]>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@sarthaknagoshe2002
Copy link
Contributor Author

sarthaknagoshe2002 commented Mar 29, 2025

This PR doesn't introduce the settings mentioned in the issue since I don't think inline script is the right way. View.js can't be used in this case since it is already used as script module for interactivity API.

A new JS file can be registered & enqueued in this case. I would love to hear some feedbacks on this before proceeding with the aforementioned solutions.

@t-hamano t-hamano added [Type] Enhancement A suggestion for improvement. [Block] Search Affects the Search Block - used to display a search field labels Mar 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Search Affects the Search Block - used to display a search field [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Search Block: Option to have live suggested results or word auto-completion
2 participants