Resolved

Problem with some links in Navigation Element on mobile.

3

I have added a Navigation element.
Built the desktop version which works as expected.
For the Mobile version I don’t want the links to mirror the desktop so I am using a UL list element block in the sliding area.

It is a two page only website; the #1 homepage and a #2 restaurant menu page.

The links in the UL are to home (top of home page) and to various sections on the #2 menu page, linked by Anchor Ids. All these work as expected.

The Strangeness
But if I add a link, either in the same UL list element or as a separate button, to the Contact section on the #1 home page using the same style Anchor Id as for the other menu items then it does not work as expected, just this one link.

Different Pages = Different Actions;
1 From home page open menu, select Contact and I can see the right hand scroll bar scroll to the right place on the page but the menu panel does not auto close. (It can be closed using the trigger button).

2 From the menu page, select Contact, and the Menu panel closes, the home page is presented at the top and scrolls a few lines then stops. It doesn’t scroll anywhere close the the Anchor Id. The browser url is showing the correct #anchor and if that is ‘entered’ then the scroll completes to the right place.

If I select any of the other link in the UL they all work as expected. Menu background closes/disappears. Page changes and scrolls as required.

Not sure if this issue is related to this one;
https://shop.greenshiftwp.com/support/navigation-block-aria-expandedtrue-conflict-on-mobile-overlay-submenus-on-wordpress-7-1-and-forward/

Simon Pushingfin

⏱

Replies

Responses

  1. Simon Pushingfin Avatar
    Simon Pushingfin
    Member

    I am trying to delete this post as it is not accurate. The Delete post function results in a ‘Server error’ message.

    So the above post is accurate but mis-leading.The problem is with all links to #Anchors on the home page. Any attempt to target them from any other web page fails. The home page loads but the page does not scroll to Anchors. If the Anchors are targeted while on the page the page does scroll. Meanwhile the issue of the Mobile menu not closing automatically also persists but I suspect is related.Smooth Scroll, Page Transitions, Back to Top button are all off. I am still searching for the cause.

  2. Simon Pushingfin Avatar
    Simon Pushingfin
    Member

    The original issued is resolved.I learned that putting a link to an anchor on a page in the mobile sliding area of the navigation element requires the leading / before the # of the anchor id or the mobile menu will not close.https://thiswebsite.com#anchortarget does not workhttps://thiswebsite.com/#anchortarget does workAs for the failing to scroll, that appears to be another issue of GS writing large amounts of sometimes orphaned styles inline while there are not settings set for this in the theme or plugin. I discovered this by hiding all sections on the page and un-hiding them one by one. Rebuidling the problem section entirely and removing the old one resolved the issue but there are inline styles still on the page. I will open a new problem report for this.

  3. support_angel Avatar
    support_angel
    Support

    Thanks for the update, glad it works. Two things we found while checking your site:

    1. The panel not closing on a link to a section of the same page: fixed in GreenLight 3.4.0. The panel now closes for these links with or without the slash before #.
    2. The page stopping short when coming from another page: this was caused by html{scroll-behavior:smooth} together with GSAP scroll animations refreshing on page load, not by the inline styles. Also fixed in 3.4.0. Your site currently has neither, which is why it works now.

About the Author