Skip to content

Conversation

@JosVelasco
Copy link

@JosVelasco JosVelasco commented Dec 31, 2025

What?

Closes #74302

Adds a name attribute to the URLInput component to prevent browser autocomplete from obscuring Gutenberg's link suggestions when adding links in the Navigation block.

Why?

When searching for pages or typing URLs in the Navigation block's link input, browsers display their own autocomplete dropdown with irrelevant search history from other websites. This creates a confusing user experience because:

  • Browser autocomplete shows irrelevant URLs/search history unrelated to the user's WordPress site
  • It visually obscures Gutenberg's page and link suggestions
  • Users may be confused about which dropdown to interact with
  • The browser suggestions provide no value in this context (site-specific link search)

Modern browsers often ignore autocomplete="off" alone, so an additional solution is needed.

How?

Added a unique name="url-input-control" attribute to the URLInput component's input props. This prevents browsers from matching the input to any saved autocomplete data, effectively disabling the browser's autocomplete dropdown while maintaining Gutenberg's link search functionality.

This fix applies to all instances where URLInput is used, including:

  • Navigation block link search
  • Link controls throughout the editor
  • Any other URL input fields

Testing Instructions

Before testing

Make sure you have some URL/search history in your browser that would normally trigger autocomplete.

Steps to test

  1. Add or edit a Navigation block
  2. Click the "+" button or click on an existing navigation item to edit it
  3. You should see an input field with placeholder "Search or type URL"
  4. Start typing in the search field (e.g., page names, URLs, or search terms)
  5. Verify that only Gutenberg's page/link suggestions appear, with no browser autocomplete dropdown
  6. Test in other contexts where URLInput is used (e.g., adding links to paragraphs, buttons, etc.)

Testing Instructions for Keyboard

  1. Use Tab to navigate to the link input field
  2. Type search terms and verify only Gutenberg's suggestions appear (no browser autocomplete)
  3. Use arrow keys to navigate through Gutenberg's suggestions
  4. Press Enter to select a suggestion

Screenshots or screencast

The issue shows browser autocomplete appearing over the block search:
The issue shows browser autocomplete appearing over the block search

After this fix, only Gutenberg's block suggestions will appear without browser interference.

@github-actions github-actions bot added [Package] Block editor /packages/block-editor First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository labels Dec 31, 2025
@github-actions
Copy link

👋 Thanks for your first Pull Request and for helping build the future of Gutenberg and WordPress, @JosVelasco! In case you missed it, we'd love to have you join us in our Slack community.

If you want to learn more about WordPress development in general, check out the Core Handbook full of helpful information.

@JosVelasco JosVelasco marked this pull request as ready for review January 1, 2026 00:21
@JosVelasco JosVelasco requested a review from ellatrix as a code owner January 1, 2026 00:21
@github-actions
Copy link

github-actions bot commented Jan 1, 2026

Warning: Type of PR label mismatch

To merge this PR, it requires exactly 1 label indicating the type of PR. Other labels are optional and not being checked here.

  • Required label: Any label starting with [Type].
  • Labels found: [Package] Block editor, First-time Contributor.

Read more about Type labels in Gutenberg. Don't worry if you don't have the required permissions to add labels; the PR reviewer should be able to help with the task.

1 similar comment
@github-actions
Copy link

github-actions bot commented Jan 1, 2026

Warning: Type of PR label mismatch

To merge this PR, it requires exactly 1 label indicating the type of PR. Other labels are optional and not being checked here.

  • Required label: Any label starting with [Type].
  • Labels found: [Package] Block editor, First-time Contributor.

Read more about Type labels in Gutenberg. Don't worry if you don't have the required permissions to add labels; the PR reviewer should be able to help with the task.

@github-actions
Copy link

github-actions bot commented Jan 1, 2026

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: JosVelasco <[email protected]>

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

@JosVelasco JosVelasco marked this pull request as draft January 1, 2026 01:05
…complete

Adds name attribute to the URLInput component to prevent browser autocomplete from obscuring link suggestions in the Navigation block and other link controls. This complements the previous fix for the block inserter search.

See WordPress#74302
@JosVelasco JosVelasco force-pushed the fix/navigation-autocomplete-74302 branch from f0a9b81 to 5a6a8bb Compare January 1, 2026 01:25
@JosVelasco JosVelasco changed the title Block Editor: Prevent browser autocomplete from obscuring block inserter search Block Editor: Prevent browser autocomplete in Navigation link search Jan 1, 2026
@JosVelasco JosVelasco marked this pull request as ready for review January 1, 2026 01:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository [Package] Block editor /packages/block-editor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Navigation block: Browser autocomplete obscures page search UI

1 participant