Breadcrumbs block allows empty separator with no fallback
Description
When testing the Breadcrumbs block, leaving the Separator field empty in the block settings does not display any visible separator between breadcrumb items in the front end and in the editor.
There’s also no validation message or fallback behaviour, and the field accepts an empty value without error or defaulting to the expected / (slash) or another symbol.
Step-by-step reproduction instructions
- Insert a Breadcrumbs block in a Page or Page template.
- In the block settings sidebar, clear the Separator field (leave it blank).
- Save the Page or Page template.
- View the editor and the frontend output.
- Observe the absence of a separator.
Screenshots, screen recording, code snippet
https://github.com/user-attachments/assets/5b3eeb11-72ed-49fc-8f57-f8ece8fe560e
Environment info
No response
Please confirm that you have searched existing issues in the repo.
- [x] Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
- [x] Yes
Please confirm which theme type you used for testing.
- [x] Block
- [ ] Classic
- [ ] Hybrid (e.g. classic with theme.json)
- [ ] Not sure
the field accepts an empty value
I'm not sure if this is considered a bug. I think the empty separator might be considered one of the valid options.
cc @ntsekouras
Oh! I couldn’t find any mention of this in the PR, so I thought it might have been missed. From my perspective, if the breadcrumbs are present but the separator symbol is accidentally omitted, the path it displays doesn’t really convey meaningful information. In my opinion, there should be a fallback symbol in such cases. Otherwise, it may also be difficult to verify accessibility (A11Y) scenarios properly.
I do not think there must be a symbol, because the names of the pages can make the context clear, styling of the block or usage of the block within the layout. I can't comment on a11y though.
separator symbol is accidentally omitted
that's valid, The UX is not ideal for that. A list of selectable characters (or icons) might help here.
@kjnanda @hanneslsm Although I am not an A11Y expert, but separators should be hidden from the screen reader because they are for decorative purpose. Also, all breadcrumb items are inside an ordered list, so screen reader will read it like link, Home, 1 of 2 and reading / will break the flow.
Also, browser got new ARIA attribute aria-current to indicate the current item in a breadcrumb, so last item should have aria-current="page". Check this ARIA Authoring Practices Guide (APG) pattern by w3.org. However, this is optional, but more meaningful.
Hi everyone, thanks for the great discussion so far! I’m still getting familiar with contributing, but I wanted to share my perspective.
I believe the separator field should not allow a blank value, because an empty separator makes the breadcrumb trail unclear, which can confuse users trying to understand the page hierarchy. Breadcrumbs are meant to visually communicate structure, and without a separator, that hierarchy is lost.
One solution could be using a TextControl with a placeholder (e.g., /, >, or →), and having it default to "/" if left blank. This would maintain flexibility while ensuring breadcrumbs remain readable and consistent. Since the current implementation allows the separator to be removed entirely, enforcing a default like "/" and guiding users with placeholder examples would help prevent accidental omissions while still allowing customization.
For accessibility, I understand that separators are decorative and should be hidden from screen readers using aria-hidden="true". At the same time, using aria-current="page" for the last item helps screen reader users understand their current location, which aligns with the ARIA Authoring Practices Guide.
Thanks again — I’m excited to learn more from everyone here and appreciate the opportunity to contribute!
Separator is added with css so it shouldn't be announced in screen readers. I just tested with VoiceOver in mac and it wasn't. I'm not 100% sure for other screen readers, so if anyone can test or knows, please share.
It seems most people agree that we shouldn't allow empty value. I'll open a PR to have the default value as fallback if the user leaves it blank.