-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Allow wrapping for Navigation block links #21632
Conversation
Size Change: +249 B (0%) Total Size: 840 kB
ℹ️ View Unchanged
|
Erm, I moved the indicator out of the anchor tag in #21471 so that the dropdown can be opened on a touchscreen. The problem with the icon being inside the link is that tapping on it on a phone will just click through to the link, so the submenus are effectively unusable. It would probably work better to make it more visibly a button instead of appearing to be inline - @karmatosed could this be an option? |
Ah, ok, didn't realise that, sorry about that! Agree it probably needs some further thought. Would be good to research what menus look like on the themes/websites that are already out there and see how they can be supported. A few I looked at seem to either just not bother with submenus on mobile (Gumtree), or switch to a fold out menu where the submenu opener is no longer a link (Amazon, Australia Post). Some use the latter approach on both desktop and mobile (The Guardian), which is one of the reasons I think we should support menu items that don't have links. |
This reverts commit a85eb79.
For now I've reverted the change to the submenu icons so that this can move forwards. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works well as a first iteration 🙂
Description
Fixes #18337.
Wraps text within a navigation link.
Links already had a
width: max-content;
rule, which prevented wrapping, so I had to remove this.I also noticed when wrapping occurs, the submenu item indicator is positioned in an unusual way (it was always positioned on the right side of the block), so this PR also fixes that by changing the location of the indicator in the DOM. The indicator is now brought inline with the text.
There's an issue in IE11 where the indicator wraps to the next line (see screenshot). I haven't been able to work out how to fix that. Advice/commits are welcome. I don't think it's any worse than it was and it only occurs when the line wraps—here's a non-wrapping line:
How has this been tested?
Screenshots
Before (Firefox)
After (Firefox)
Before (IE 11)
After (IE 11)
Types of changes
Bug fix (non-breaking change which fixes an issue)
Checklist: