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

Fix styling issues of meganav on small screens #5110

Merged
merged 16 commits into from
Aug 9, 2024
Merged

Fix styling issues of meganav on small screens #5110

merged 16 commits into from
Aug 9, 2024

Conversation

bartaz
Copy link
Member

@bartaz bartaz commented Jun 5, 2024

Done

Addresses styling and scrolling issues in mobile version of mega navigation

  • fixes scroll when there are many items in the nav on mobile
  • removes visual glitches when scrolling
  • makes styling inside mobile nav more consistent

Fixes: https://warthogs.atlassian.net/browse/WD-13787

QA

QA Note

In Vanilla examples view the bottom toolbar is covering some space on the bottom of the screen. In normal view it would not be there and there will be more of the dropdown visible.

image

Implementation note

This PR introduces 2 new class names required by JS.

js-navigation-sliding-panel needs to be added on the elements with p-navigation__dropdown CSS class name (so that they are correctly targeted when selecting a dropdown to activate), it also needs to be added on a top level p-navigation__items element (the one containing first level of mobile sliding navigation items)

js-navigation-dropdown-toggle needs to be added on elements with p-navigation__item--dropdown-toggle class name.

@webteam-app
Copy link

@bartaz bartaz changed the title WIP: sliding meganav in Vanilla Fix styling issues of meganav on small screens Aug 7, 2024
@bartaz bartaz added Review: QA needed Review: Code needed Bug 🐛 Review: Percy needed This PR needs a review of Percy for visual regressions and removed Don't merge labels Aug 7, 2024
@bartaz bartaz marked this pull request as ready for review August 7, 2024 16:33
@jmuzina jmuzina self-requested a review August 7, 2024 16:34
@jmuzina
Copy link
Member

jmuzina commented Aug 7, 2024

Reduced navigation: should have the same content and work the same: https://vanilla-framework-5110.demos.haus/docs/examples/patterns/navigation/reduced?theme=light

Reduced nav example now defaults to being opened, which removes the non-opened nav from visual testing coverage. is this intended?

@pastelcyborg pastelcyborg self-requested a review August 7, 2024 16:45
@bartaz
Copy link
Member Author

bartaz commented Aug 8, 2024

Reduced nav example now defaults to being opened, which removes the non-opened nav from visual testing coverage. is this intended?

Good catch. I made it open in the dropdown full width example, but it doesn't have to be open in reduced example. Updated.

@petesfrench
Copy link
Contributor

Could we add a couple rems to the bottom of the list views? Currently the last item is almost flush with the view port making it quite hard to read/click.

@bartaz
Copy link
Member Author

bartaz commented Aug 8, 2024

Could we add a couple rems to the bottom of the list views? Currently the last item is almost flush with the view port making it quite hard to read/click.

I hacked in some spacing there. This should hopefully add a bit of space there and help with the 100vh address bar issue (because there should be enough spacing to scroll past the height of address bar).

Solution is ugly, but I couldn't find any better way. The way the sliding panels are structured and how the scroll works there is a mystery. And I don't think we can do much better without some significant changes there.

@jmuzina jmuzina added Review: Percy +1 and removed Review: Percy needed This PR needs a review of Percy for visual regressions labels Aug 8, 2024
@jmuzina
Copy link
Member

jmuzina commented Aug 8, 2024

Clicking the "LXCFS -> Nested Layer" dropdown on the sliding dark example and then clicking nested layer dropdown multiple times causes the takeover overlay to disappear while the navigation is still open - this seems unexpected

Screen.Recording.2024-08-08.at.12.28.46.PM.mov

However this happens on main / staging right now, so I'm not sure if it's a problem we have to worry about for this PR

@bartaz
Copy link
Member Author

bartaz commented Aug 8, 2024

Clicking the "LXCFS -> Nested Layer" dropdown on the sliding dark example and then clicking nested layer dropdown multiple times causes the takeover overlay to disappear while the navigation is still open - this seems unexpected

Good catch @jmuzina . Not ideal for sure, and not expected, but this is an edge case that doesn't happen in production (we don't use nested dropdowns like these in prod). It's an old example from the times when we did have support for sliding navigation on mobile, but not full meganav dropdowns. Maybe it will make sense to drop them now.

But I'd rather ignore it in this PR, and address separately.

@pastelcyborg pastelcyborg self-requested a review August 8, 2024 18:40
pastelcyborg
pastelcyborg previously approved these changes Aug 8, 2024
@jmuzina
Copy link
Member

jmuzina commented Aug 8, 2024

Clicking the "LXCFS -> Nested Layer" dropdown on the sliding dark example and then clicking nested layer dropdown multiple times causes the takeover overlay to disappear while the navigation is still open - this seems unexpected

Good catch @jmuzina . Not ideal for sure, and not expected, but this is an edge case that doesn't happen in production (we don't use nested dropdowns like these in prod). It's an old example from the times when we did have support for sliding navigation on mobile, but not full meganav dropdowns. Maybe it will make sense to drop them now.

But I'd rather ignore it in this PR, and address separately.

Created #5288 to tackle that issue separately!

@bartaz bartaz dismissed stale reviews from jmuzina and pastelcyborg via d086e03 August 9, 2024 09:35
@bartaz bartaz merged commit 2d27e9e into main Aug 9, 2024
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants