-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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 block: can't unlink items #18866
Comments
I can confirm I also am unable to remove a link once added. Thanks for finding this @sophiegyo. |
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 |
Is that |
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. |
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 |
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. |
A few things have changed since this ticket was created, here's a fresh look: 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. |
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 🙂 |
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. |
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. |
Just to say that we have added an Update: PR to implement this now ready for review in #33777 |
Closed by #33777 |
@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 |
#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. |
Hm, I think this was mistakenly closed; it's not possible to create navigation items that render on the front end without links yet. |
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:
Expected behavior
I would have expected to be able to modify the link, to prevent the link from being active!
Screenshots
Chrome:
Firefox:
Desktop (please complete the following information):
I've not yet tested on a smartphone!
The text was updated successfully, but these errors were encountered: