Block Editor: Prevent browser autocomplete in Navigation link search #74305
+1
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What?
Closes #74302
Adds a
nameattribute 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:
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:
Testing Instructions
Before testing
Make sure you have some URL/search history in your browser that would normally trigger autocomplete.
Steps to test
Testing Instructions for Keyboard
Screenshots or screencast
The issue shows browser autocomplete appearing over the block search:

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