Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
Once the combined width of menu items exceed the available container width, they overflow outside their intended home.
When this happens, the page becomes horizontally scrollable, and attempts to horizontally scroll result in a redraw loop, which can be seen in this video: overflow-glitch.mov
Bartik addresses this by wrapping menu items to a new line if needed. It's quite possible there's a more elegant way to address this. If a more elegant solution exists I'm confident the folks working on Olivero will find it 🙂.
Steps to reproduce
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
Release notes snippet
Comment | File | Size | Author |
---|---|---|---|
#41 | Capture d’écran 2021-10-29 230345.png | 56.71 KB | zenimagine |
#41 | Capture d’écran 2021-10-29 230316.png | 59.1 KB | zenimagine |
#31 | After Patch 3186992.png | 341 KB | chetanbharambe |
#31 | Before Patch 3186992 up.png | 357.23 KB | chetanbharambe |
#30 | Patch NA 3186992.png | 521.33 KB | chetanbharambe |
Comments
Comment #2
hitvika_verma CreditAttribution: hitvika_verma at OpenSense Labs commentedComment #3
anmolgoyal74 CreditAttribution: anmolgoyal74 at OpenSense Labs for DrupalFit commentedComment #4
ranjith_kumar_k_u CreditAttribution: ranjith_kumar_k_u at Zyxware Technologies commentedI have tested the above patch on 9.2,the patch applied cleanly but it does not fix the issue.
After patch LTR
After patch RTL
Comment #5
ranjith_kumar_k_u CreditAttribution: ranjith_kumar_k_u at Zyxware Technologies commentedComment #6
djsagar CreditAttribution: djsagar at OpenSense Labs commentedPatch is resolved this issue please see the screen short for clarification.
Thanks!
Comment #7
djsagar CreditAttribution: djsagar at OpenSense Labs commentedComment #8
bnjmnmI noticed all the patches are making direct edits to .css files that begin with this warning
Edits should be made to the corresponding .pcss.css file, and compiled. Running
yarn watch
while you edit the .pcss.css files should be sufficient.I'd also recommend checking with the Olivero designers as they may want this to be fixed in a specific way. The links overflowing outside of the header like they do in #6 probably isn't what they had in mind.
Comment #9
djsagar CreditAttribution: djsagar at OpenSense Labs commentedHi @bnjmnm,
Thank you for your feedback.
I re-uploaded patch by running
yarn watch
.Please review.
Comment #10
babusaheb.vikas CreditAttribution: babusaheb.vikas commentedI tested 3186992-9.patch patch with extra menu items. For alignment working good. But after scroll, the page down the menu items design is breaking. That is not looking good.
Please find the screenshot.
Comment #11
babusaheb.vikas CreditAttribution: babusaheb.vikas commentedComment #12
hinal05 CreditAttribution: hinal05 as a volunteer and at QED42 for Drupal India Association commentedComment #13
hinal05 CreditAttribution: hinal05 as a volunteer and at QED42 for Drupal India Association commentedApplied patch #9 and also updated new patch for navigation scroll alignment. Please review it.
@babusaheb.vikas : I have applied the patch for scrolling menu but it's not proper solution for default theme. I have did override padding for specific scrolled navigation but it's just for some limited links (like max 2 lines). After adding more links(more than 2 lines) it will breaking again. so, as per requirement need to override css.
Main menu show for clear and concise, need to change navigation as per below suggestions.
- Reduce number of top level links
- Reduce length of link titles
- Reconsider menu hierarchy
- Reduce font size
- Remove 'Home' link because if you clicking on the logo in your Header will take you back to the homepage.
Comment #14
hinal05 CreditAttribution: hinal05 as a volunteer and at QED42 for Drupal India Association commentedPlease review updated patch.
Comment #15
BhumikaVarshney CreditAttribution: BhumikaVarshney as a volunteer and at OpenSense Labs commentedApplied patch #14 and it works fine.Adding screenshots below.
Comment #16
imalabyaLooks good to me, Moving to RTBC
Comment #17
lauriiiWe shouldn't use js- prefixed classes for styling since they are only supposed to be used for functionality. For more info, see #2431671: [meta] Add in js- prefixed classes for separation of JS & CSS functionality.
Comment #18
tushar_sachdeva CreditAttribution: tushar_sachdeva at OpenSense Labs commentedComment #19
tushar_sachdeva CreditAttribution: tushar_sachdeva at OpenSense Labs commented@lauriii removed
as it was not affecting menu because .js-fixed class comes into play when menu is closed. Quick and easy patch applied .
Comment #20
tushar_sachdeva CreditAttribution: tushar_sachdeva at OpenSense Labs commentedComment #21
tushar_sachdeva CreditAttribution: tushar_sachdeva at OpenSense Labs commentedComment #22
Sakthivel M CreditAttribution: Sakthivel M at QED42 commentedApplied patch #19 and it works fine. Adding screenshots below.
1+ RTBC
Comment #23
Abhijith S CreditAttribution: Abhijith S as a volunteer and at Zyxware Technologies commentedApplied patch #19 and it worked fine.
Before patch:
After patch:
RTBC +1
Comment #24
kiran.kadam911Comment #27
catchRestoring status after HEAD was broken.
Comment #29
kiran.kadam911Re-Rolled with 9.3.x
Kindly review the attached patch.
Thanks!
Comment #30
chetanbharambe CreditAttribution: chetanbharambe at QED42 for Drupal India Association commentedHi @kiran,
Verified and tested patches #29.
The patch does not apply successfully.
Please refer attached screenshots.
Moving to Needs work.
Comment #31
chetanbharambe CreditAttribution: chetanbharambe at QED42 for Drupal India Association commentedHi, @kiran Thank you for the patch.
Verified and tested patch #29.
Patch applied successfully and looks good to me.
Testing Steps:
# Goto: Appearance: Apply Olivero theme
# Goto admin/structure/menu
# Add 7-8 menus under the main navigation
# See the results
Expected Results:
# Navigation menu items should not overflow outside of container.
Actual Results:
# Navigation menu items can overflow outside of container.
Please refer attached screenshots.
Looks good to me.
Can be a move to RTBC.
Comment #33
bnjmnmUnrelated test failure pushed this out of RTBC. Switching back to the RTBC @chetanbharambe set in #31, with no additional review from me.
Comment #35
bnjmnmUnrelated test failure set this to needs work. Switching back no RTBC based on #31 - no additional review from me
Comment #36
alexpott@lauriii and I discussed this and agreed that this can be committed once the 9.3 alpha freeze is over.
Comment #37
lauriiiReviewed this issue and I think this is ready to be committed after the alpha freeze ends.
Removing the needs subsystem maintainer review tag since I don't think this actually needs subsystem maintainer review.
Comment #38
alexpottCommitted and pushed 4063e76cbe to 9.4.x and beb3bf6e6c to 9.3.x. Thanks!
Backported to 9.3.x as olivero is not stable yet and might be marked stable in 9.3.0.
Comment #41
zenimagine CreditAttribution: zenimagine commented@alexpt I think this functionality is incomplete. There should be an option in the Olivero theme configuration to set the menu to 2 lines or to put the menu in mobile mode when the links touch the logo + name area.
Here is an example, reducing the window in width. When one of the menu links touches the logo area + no, it automatically switches to mobile mode :
https://www.clubic.com/
In my case (see screenshots), I would like that when the menu touches the gray area (logo + site name), it automatically switches to mobile mode.
Comment #42
alexpott@zenimagine can you open a follow-up issue for that?
Comment #43
zenimagine CreditAttribution: zenimagine commentedyes
Comment #44
mherchelOpened up #3247269: Olivero: Alignment of primary menu hover states and dropdowns is incorrect at wide widths as a regression to this issue.
Sorry I've been out for a bit, I've been meaning to review this but a good amount of personal stuff got in the way.