Skip to content

Enhance Search Block with Live Results Dropdown#69755

Open
sarthaknagoshe2002 wants to merge 2 commits intoWordPress:trunkfrom
sarthaknagoshe2002:search-block/live-search
Open

Enhance Search Block with Live Results Dropdown#69755
sarthaknagoshe2002 wants to merge 2 commits intoWordPress:trunkfrom
sarthaknagoshe2002:search-block/live-search

Conversation

@sarthaknagoshe2002
Copy link
Copy Markdown
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

@github-actions
Copy link
Copy Markdown

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 <sarthaknagoshe2002@git.wordpress.org>
Co-authored-by: cbirdsong <cbirdsong@git.wordpress.org>
Co-authored-by: bhubbard <bhubbard@git.wordpress.org>

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

@sarthaknagoshe2002
Copy link
Copy Markdown
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