Skip to content

Navigation block: can't unlink items #18866

Closed

Description

@sophiegyo

After creating a navigation block and adding a few items, it doesn't seem possible to un-link them.

Gutenberg version tested: 7.0.0

To reproduce
Steps to reproduce the behavior:

  1. Add a new page, and add a navigation block
  2. Add a few items to the block, making sure they're linked pages
  3. Save/publish the page
  4. Attempt to unlink an item by modifying it and deleting the listed page
  5. Notice appears to fill in the field. Clicking away from the field closes it and loses the modification (removal)

Expected behavior
I would have expected to be able to modify the link, to prevent the link from being active!

Screenshots

Chrome:
navblockunlink

Firefox:
navblockff

Desktop (please complete the following information):

  • OS: macOS Mojave 10.14.6
  • Browser: Chrome 78.0.3904.108, also tested on Firefox 70.0.1

I've not yet tested on a smartphone!

Activity

  1. karmatosed commented on Dec 2, 2019

    @karmatosed
    Member

    I can confirm I also am unable to remove a link once added. Thanks for finding this @sophiegyo.

  2. added
    [Type] Bug
    on Dec 2, 2019
  3. obenland commented on Dec 3, 2019

    @obenland
    Member

    Currently the navigation block only allows (navigation) links as child blocks. There has been some exploration in #18442 to allow non-linked links, but I'm not sure that'll be viable. The idea here is that other types of blocks (like a text block in this case) could be added later, to enable a way to create richer navigation menus.

    Rather than considering this a bug, I'd advocate for adding the ability to accept other types of child blocks.

    /cc @mtias

  4. sophiegyo commented on Dec 9, 2019

    @sophiegyo
    Author

    Is that still also the case for top-level items? The Firefox screencast I linked shows me trying to unlink a top-level navigation item, rather than a child item.

  5. added
    [Block] Navigation
    on Apr 1, 2020
  6. added
    [Feature] Link Editing
    on Sep 23, 2020
  7. paaljoachim commented on Apr 8, 2021

    @paaljoachim
    Contributor

    Testing using WordPress 5.7. Twenty Twenty One. Gutenberg plugin 10.3.2

    Clicking a link and removing the url. Then clicking outside of the link control box automatically adds the link back in again.
    So yes one can not unlink items. Either one changes the link or one deletes the link. (There still needs to be a way to add text into the menu.)

  8. gwwar commented on Apr 8, 2021

    @gwwar
    Contributor

    I agree that it'd be good to allow folks to add text headings to help group navigation links. I do think we could let folks add this more directly, vs adding a link and then removing the url. For example in the inserter we might let folks pick adding a heading.

    Were there any thoughts on this already? cc @jasmussen or @scruffian

    As a quick example Amazon does the following, to group links together. Notice how "Trending" isn't a link

    Screen Shot 2021-04-08 at 12 23 31 PM

  9. shaunandrews commented on Apr 8, 2021

    @shaunandrews
    Contributor

    What purpose does "unlinking" a Link block serve?

    As I see it, the Link block (and its variations) requires a URL to do its job. Once set, there's no way to remove a URL, only change it. This is intentional, and I'm not sure we should build a way to "unset" a Link block's URL without some greater purpose or workflow.

  10. jasmussen commented on Apr 9, 2021

    @jasmussen
    Contributor

    A few things have changed since this ticket was created, here's a fresh look:

    current status

    Notably, there's a new menu item placeholder state which does not allow you to edit a label until a link has been added. By adding this we're implicitly saying: a menu item without a link is useless. In that vein, unlinking a menu item isn't directly useful anymore. However we can be clearer about the user experience. While the "The field must be filled out" is a good start, the messaging around it can be improved. I don't know if that has to be this ticket or a separate URL component-specific one.

    The second part, being able to add text to a menu, that absolutely should be possible. A brief (and intentionally crazy) exploration suggests that's not going to be too hard. The biggest challenge for that is this ticket. I'm tinkering with a mockup (wip) that relies on being able to add single paragraphs, so it's definitely something we want.

  11. tellthemachines commented on Jul 8, 2021

    @tellthemachines
    Contributor

    Now that #29036 has been resolved, would this issue be fixed if we allowed adding Paragraph blocks at the top level of the Navigation block? If so, that's easy to sort out 🙂

  12. jasmussen commented on Jul 8, 2021

    @jasmussen
    Contributor

    Good thought @tellthemachines. If not the paragraph, then at least a range of other blocks would bring value, so I created #33278 to track that.

    If we were to allow the Paragraph block, would that change the default behavior of the appender? I'd think we'd still want the black plus being the only way to add items, rather than having an input field with a slash command prompt.

  13. tellthemachines commented on Jul 9, 2021

    @tellthemachines
    Contributor

    If we were to allow the Paragraph block, would that change the default behavior of the appender? I'd think we'd still want the black plus being the only way to add items, rather than having an input field with a slash command prompt.

    We'd have to look into it, though I'm starting to think using Paragraph might not be a good idea, for multiple reasons outlined here.

  14. added
    [Status] In Progress
    on Jul 12, 2021
  15. getdave commented on Jul 30, 2021

    @getdave
    Contributor

    Just to say that we have added an Unlink behaviour in the Post Editor. I can add this to the Nav Editor as well.

    Update: PR to implement this now ready for review in #33777

  16. draganescu commented on Aug 4, 2021

    @draganescu
    Contributor

    Closed by #33777

  17. getdave commented on Aug 4, 2021

    @getdave
    Contributor

    @draganescu Worth noting that we may need to create a follow up to address another part of this Issue which is that folks want to be able to create link items which have no hyperlink. I believe this is what @tellthemachines is addressing in #33775

  18. jasmussen commented on Aug 4, 2021

    @jasmussen
    Contributor

    #33091 would also be related to link items with no link, insofar as that ticket can only be addressed if we were to allow that.

  19. tellthemachines commented on Aug 30, 2021

    @tellthemachines
    Contributor

    Hm, I think this was mistakenly closed; it's not possible to create navigation items that render on the front end without links yet.

  20. removed
    [Status] In Progress
    on Sep 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

[Block] Navigation[Feature] Link Editing[Type] Bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions