Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Social Links: Add disableSuggestions to URLInput #18946

Merged
merged 1 commit into from
Dec 6, 2019

Conversation

mkaz
Copy link
Member

@mkaz mkaz commented Dec 5, 2019

Description

In #18905 Social Links was switched from a generic input field to using URLInput, this change adds disableSuggetions to prevent the field to suggest internal links or pages since Social Links are typically an external link.

Related, but not dependent, the Social Links can probably also benefit from this issue
#11852

How has this been tested?

  1. Base Case. Add a Social Links block, insert a link and in the URL field type "About" or other page or post name and you should see a list of suggestions.

  2. Apply PR. Repeat 1 and as you start typing you should not see the suggestions

Types of changes

Adds disableSuggestions parameter to URLInput component for Social Links.

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • My code has proper inline documentation.

In #18905 Social Links was switched from a generic input field to using
URLInput, this change adds disableSuggetions to prevent the field to
suggest internal links or pages since Social Links are typically an
external link.
@mkaz mkaz added the [Block] Social Affects the Social Block - used to display Social Media accounts label Dec 5, 2019
@mkaz mkaz requested review from jasmussen and aduth December 5, 2019 16:51
Copy link
Contributor

@jasmussen jasmussen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, nice and simple.

Before:

before

After:

after

@youknowriad
Copy link
Contributor

Based on the screenshot, I might think the loaded is unnecessary when the suggestions are disabled. The API shouldn't be called at all?

@youknowriad
Copy link
Contributor

It could be a separate fix though as it seems that this prop already exists.

@mkaz mkaz merged commit fee02da into master Dec 6, 2019
@mkaz mkaz deleted the update/social-links-disable-suggestions branch December 6, 2019 14:24
@aduth aduth changed the title Social Links: Add disableSuggetions to URLInput Social Links: Add disableSuggestions to URLInput Dec 6, 2019
@youknowriad youknowriad added this to the Gutenberg 7.1 milestone Dec 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Social Affects the Social Block - used to display Social Media accounts
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants