Skip to content

Font Library: Trim whitespace from font search input#76871

Open
annezazu wants to merge 1 commit intoWordPress:trunkfrom
annezazu:fix/font-library-search-trim-whitespace
Open

Font Library: Trim whitespace from font search input#76871
annezazu wants to merge 1 commit intoWordPress:trunkfrom
annezazu:fix/font-library-search-trim-whitespace

Conversation

@annezazu
Copy link
Copy Markdown
Contributor

Summary

Fixes an issue where searching for a font name with leading or trailing spaces (e.g., "Roboto ") in the Font Library's Install Fonts tab returned no results. Adds .trim() to the search term before comparison, consistent with other search utilities in the codebase (dataviews, block-library, editor).

Closes #76866

Test plan

  • Open the Font Library
  • Go to the "Install Fonts" tab
  • Search for a font name with a trailing space (e.g., "Roboto ")
  • Confirm results are displayed correctly
  • Search with a leading space (e.g., " Roboto")
  • Confirm results are displayed correctly
  • Search without extra spaces to confirm normal behavior is unchanged

🤖 Generated with Claude Code

Fixes an issue where searching for a font name with leading or trailing
spaces (e.g., "Roboto ") returned no results. Adds .trim() to the search
term before comparison, consistent with other search utilities in the
codebase (dataviews, block-library, editor).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@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: annezazu <annezazu@git.wordpress.org>

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

@annezazu annezazu added [Type] Bug An existing feature does not function as intended [Feature] Font Library labels Mar 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Feature] Font Library [Type] Bug An existing feature does not function as intended

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Font Library: ensure searching for a font still works even if there is a space in the search field

1 participant