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

Block Library: Navigation: Remove title attribute from navigation link #19990

Merged
merged 1 commit into from
Feb 6, 2020

Conversation

aduth
Copy link
Member

@aduth aduth commented Jan 31, 2020

Previously: #19735, #17352, #19462 (comment), #19490 (comment), #616

This pull request seeks to remove the title attribute from the Navigation Link block.

For more context, refer to #19735, which includes additional resources for why we should be avoiding the title attribute for links.

Note: To disambiguate, the Navigation Link block will still handle a title from a suggestion in the LinkControl input that it renders. From what I can tell, this is used to assign a default text label of the link. I expect that LinkControl will still continue to offer a title value when the selected link changes. This is consistent from what is reported by the search results endpoint and can be useful for these sorts of scenarios in using e.g. a post title. This is not to be confused with the title HTML attribute, which we should seek to avoid for a anchor tags.

There is not expected to need to be a deprecation here, since the title was used in the dynamic server-side rendering and not in the saved static markup of the block.

Testing Instructions:

Verify that there are no regressions in creating, saving, and previewing a post containing a Navigation and Navigation Link block:

  1. Navigate to Posts > Add New
  2. Insert a Navigation block
  3. Click the "Create empty" button
  4. Add a link
  5. Save and preview the post
  6. Verify that the navigation and navigation link are shown correctly

@aduth aduth added [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). [Block] Navigation Affects the Navigation Block labels Jan 31, 2020
@aduth
Copy link
Member Author

aduth commented Feb 3, 2020

Related: #18061 (comment)

Removing this attribute would cause the LinkControl link previews to no longer show the title associated with a link. However, as I mentioned in the linked comment, this seems like a problem that needs to be addressed generally for all LinkControl, and not be made a responsibility of individual blocks.

Copy link
Contributor

@draganescu draganescu left a comment

Choose a reason for hiding this comment

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

The code is good and the block is unaffected other than not setting titles on links. LGTM!

@draganescu
Copy link
Contributor

@aduth there are some conflicts here apparently because of the new linting updates in master. Everything else is good to go.

@aduth aduth force-pushed the update/navigation-link-remove-title branch from b2423f9 to 2a187c8 Compare February 5, 2020 20:41
@aduth
Copy link
Member Author

aduth commented Feb 5, 2020

Thanks @draganescu . I've force-pushed a rebased branch, so it should be all clear now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Navigation Affects the Navigation Block [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes).
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants