Skip to content
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

Enable popper for the submenu too (opens on hover) #16041

Merged
merged 5 commits into from
Mar 1, 2022
Merged

Enable popper for the submenu too (opens on hover) #16041

merged 5 commits into from
Mar 1, 2022

Conversation

Jako
Copy link
Collaborator

@Jako Jako commented Feb 7, 2022

What does it do?

Apply Popper on subsubnav elements. Change the CSS to be used with Popper. The nav on System Settings is opened below of the entry on mobile. A CSS rule avoids the subsubnav to grow larger than the viewport. The subsubnav content is scrollable.

Why is it needed?

Fix a position out of the viewport for subsubnav elements. The use of Popper avoids the subsubnav be moved partly out of the viewport. Currently large subsubnavs are cut of at the bottom of the screen. Scrolling can be a future option for this (see #16041 (comment)).

How to test

Before: Reload the dashboard page with a viewport height of 700px. Open the 'manage' menu and look for the subnav of Reports. It is cut off on the bottom.
After: Run grunt build and do the same. The subnav of Reports is not cut off on the bottom.

Related issue(s)/PR(s)

#16029

The following desktop issues are fixed

Language before (subsubnav: 86vh):
Language Before
Language after (subsubnav: 100vh - 12px):
Language After
Reports before:
Reports Before
Reports after:
Reports After
Long extras before:
Long Extras Before
Long extras after:
Long Extras After

The following mobile issues are fixed

Language Before:
Language Before
Language After:
Language After
Long Extras Before:
Long Extras Before
Long Extras After:
Long Extras After

System Settings Before:
System Settings Before
System Settings After:
System Settings After

@Jako Jako requested review from Mark-H and opengeek as code owners February 7, 2022 17:11
@cla-bot cla-bot bot added the cla-signed CLA confirmed for contributors to this PR. label Feb 7, 2022
@smg6511
Copy link
Collaborator

smg6511 commented Feb 8, 2022

Can you provide a couple screenshots showing the issue. I'm trying to replicate it (testing on Chrome) and can not get the menu to cut off (looking at a previous beta release). I feel like I've seen issues with the submenus before, but just can't seem to make it happen now.

@Jako
Copy link
Collaborator Author

Jako commented Feb 9, 2022

Please look into the linked issue. If that's not enough, I can provide some extra examples.

@smg6511
Copy link
Collaborator

smg6511 commented Feb 9, 2022

Sorry about that @Jako I thought I'd looked back at the issue, but had not (a second time, that is — I'd commented on the very issue you pointed me to!). Lot's going on ;-)

At any rate, would it be accurate to say it's an issue affecting certain browsers? I didn't see it on Chrome, but will take a look on Firefox and Safari.

@Jako
Copy link
Collaborator Author

Jako commented Feb 9, 2022

I have added some screenshots to the PR description. The screenshots are created with Chrome. I don't think thats only affecting certain browsers.

@smg6511
Copy link
Collaborator

smg6511 commented Feb 9, 2022

@Jako - Thanks for the images. You're right—it's all browsers. Whatever is causing the issue was introduced after beta-1. In the current 3.x repo I see the problems.

@Jako
Copy link
Collaborator Author

Jako commented Feb 9, 2022

Maybe it was introduced with #15970

Copy link
Collaborator

@Ruslan-Aleev Ruslan-Aleev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the level is greater than 2, then the menu does not work.

Here is the menu I created:
menu_level_3

What it looks like:
menu_level_3_2

@Jako
Copy link
Collaborator Author

Jako commented Feb 11, 2022

@Ruslan-Aleev Thanks, that occured after setting overflow-y for all submenus. It can be solved like this: https://css-tricks.com/popping-hidden-overflow/, but the current CSS of the sub(sub)menus is annoying complicated and I need some time to prepare that later. I will reset the overflow only to the language list.

@Jako
Copy link
Collaborator Author

Jako commented Feb 11, 2022

It works now. Long subsubnavs are currently not scrolling, but this issue was there before. It can't be fixed fast (see the comments above), but it is better than the current state.

@Jako Jako added the pr/review-needed Pull request requires review and testing. label Feb 12, 2022
@Jako Jako added this to the v3.0.0-pl milestone Feb 12, 2022
Copy link
Collaborator

@Ruslan-Aleev Ruslan-Aleev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, works better than what we have now.
But in the future, we should think about something with overflow: hidden; and position: absolute;

@JoshuaLuckers
Copy link
Contributor

There is a horizontal scroll in the language toggle, otherwise it works as described! Great work.

Screen Shot 2022-02-19 at 09 47 06

@Jako
Copy link
Collaborator Author

Jako commented Feb 19, 2022

@JoshuaLuckers I can't reproduce this here in Chrome + Firefox. Did you resize the window before without reloading the page? The position of the user menu seems wrong too.

@JoshuaLuckers
Copy link
Contributor

@Jako yeah I did resize the screen, the menu opens in the right position after refreshing the manager.
The horizontal scrollbar still appears.

If I remove the width from the #modx-footer .modx-subnav li a selector the horizontal scrollbar disappears.
Screen Shot 2022-02-19 at 14 53 10

P.s: I'm using Safari (desktop)

@Jako
Copy link
Collaborator Author

Jako commented Feb 19, 2022

@JoshuaLuckers Thanks, Safari did indeed show the scrollbar. It is removed with the last change. Can anyone test this on Edge?

@JoshuaLuckers
Copy link
Contributor

Chromium Edge? Or the "old" Edge?

@Jako
Copy link
Collaborator Author

Jako commented Feb 20, 2022

The one I can't test because I am on a Mac.

@JoshuaLuckers
Copy link
Contributor

@Ruslan-Aleev @Ibochkarev you guys use Windows right?

@Ruslan-Aleev
Copy link
Collaborator

you guys use Windows right?

@JoshuaLuckers Yes, I am using Windows OS.

@Jako
Copy link
Collaborator Author

Jako commented Feb 20, 2022

Can you test this PR on Edge please?

@Ruslan-Aleev
Copy link
Collaborator

Can you test this PR on Edge please?

There are no extra scrolls, it works similarly to Google Chrome (in Edge Cromium is inside).

@opengeek opengeek merged commit 1608e8e into modxcms:3.x Mar 1, 2022
@Jako Jako deleted the submenu-popper-hover branch March 2, 2022 09:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed CLA confirmed for contributors to this PR. pr/review-needed Pull request requires review and testing.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants