Skip to content

Link UI briefly shows unwanted rich preview for internal URLs #32657

@getdave

Description

@getdave

Description

Due to the introduction of loading placeholders towards the end of #31464, internal URLs will now briefly showing a "loading" state. This is not desirable.

This PR fixes this by testing against a base URL which is used to test if the URL being previewed is an internal URL. If it is then we bail out.

This baseURL has been added to the @wordpress/editor block editor settings as we cannot apply the test directly in as this must remain WordPress agnostic. Note however, that the concept of a internal URL applies to all types of application.

Step-by-step reproduction instructions

  1. Create link to internal URL (ie: a Page or Post).
  2. Click on link again to see preview.
  3. See brief loading UI flash up.

Expected behaviour

Should not show any rich preview loading state (or otherwise) for internal URLs.

Actual behaviour

Shows a briefly "loading" UI for rich previews even if the URL is internal.

Screenshots or screen recording (optional)

Screen Capture on 2021-06-11 at 09-30-22

Code snippet (optional)

WordPress information

  • WordPress version:
  • Gutenberg version:
  • Are all plugins except Gutenberg deactivated?
  • Are you using a default theme (e.g. Twenty Twenty-One)?

Device information

  • Device:
  • Operating system:
  • Browser:

Metadata

Metadata

Assignees

Labels

[Feature] Link EditingLink components (LinkControl, URLInput) and integrations (RichText link formatting)[Type] BugAn existing feature does not function as intended

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions