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

Navigation Menu: render item without link #18442

Closed
wants to merge 11 commits into from

Conversation

retrofox
Copy link
Contributor

@retrofox retrofox commented Nov 11, 2019

It handles the case when the item has not defined a link, rendering the item with a <span> element instead of an anchor <a>.

Description

How has this been tested?

Add an item without a link from the Editor canvas.
Confirm the markup sets an anchor element to those items that have defined a link, and sets a element when there aren't. Pay attention to the CSS class as well.

Screen Shot 2019-11-13 at 12 02 06 PM

Screenshots

image

Types of changes

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • My code has proper inline documentation.
  • I've included developer documentation if appropriate.
  • I've updated all React Native files affected by any refactorings/renamings in this PR. .

@retrofox retrofox added [Feature] List View Menu item in the top toolbar to select blocks from a list of links. [Block] Navigation Affects the Navigation Block labels Nov 11, 2019
Copy link
Member

@obenland obenland left a comment

Choose a reason for hiding this comment

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

All values being output into an element attribute need to be run through esc_attr().

Copy link
Contributor

@tellthemachines tellthemachines left a comment

Choose a reason for hiding this comment

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

Thanks for working on this! Just a few fairly minor comments/questions below.

packages/block-library/src/navigation-menu/index.php Outdated Show resolved Hide resolved
packages/block-library/src/navigation-menu/index.php Outdated Show resolved Hide resolved
@retrofox retrofox force-pushed the update/nav-menu-no-link-menu branch from ef26329 to 1a980dd Compare November 13, 2019 13:24
mtias and others added 8 commits November 14, 2019 15:51
If we end up going with a different term, at least we'll have a better idea what it all is that needs updating.
It handles the case when the item has not defined a linl, rendering the item with an <span> element instrad of an anchor <a>.
@retrofox retrofox force-pushed the update/nav-menu-no-link-menu branch from 4d61148 to 8c5bc36 Compare November 14, 2019 19:44
@retrofox retrofox requested review from nerrad and ntwb as code owners November 14, 2019 19:44
@talldan talldan removed the [Feature] List View Menu item in the top toolbar to select blocks from a list of links. label Jun 11, 2020
@draganescu draganescu mentioned this pull request Dec 8, 2020
37 tasks
Base automatically changed from master to trunk March 1, 2021 15:42
@jasmussen
Copy link
Contributor

@retrofox is this one outdated now that we have a placeholder state for empty menu items?

nav

@retrofox
Copy link
Contributor Author

@retrofox is this one outdated now that we have a placeholder state for empty menu items?

Yeah, pretty sure it is! let me close it. Thanks for the ping 👍

@retrofox retrofox closed this Mar 18, 2021
@sirreal sirreal deleted the update/nav-menu-no-link-menu branch June 20, 2024 11:50
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants