[wp-trac] [WordPress Trac] #56274: Linking to an element on the same page does not work in the mobile menu in the Twenty twenty-two theme

WordPress Trac noreply at wordpress.org
Sat Jul 23 08:03:07 UTC 2022


#56274: Linking to an element on the same page does not work in the mobile menu in
the Twenty twenty-two theme
--------------------------+-----------------------------
 Reporter:  juhosa        |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Themes        |    Version:  6.0
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 Running WordPress version 6.0.1

 Steps to reproduce:

 1. Install WordPress, use the default Twenty twenty-two theme
 2. Create a page, add some ipsum lorem to give length to the page, add a
 link to an element at the bottom of the page (#news for example), set this
 page as the home page from Reading settings
 3. Create a menu item that links to your element on the page (#news in
 this example)
 4. View the page on your mobile device or by using mobile view on your
 browser
 5. Click/tap the mobile menu, click/tap on the #news link

 Expected behaviour: the menu closes and the page scrolls to the relevant
 element (the one with the #news anchor)

 What happens instead: The menu does not close when you click the link and
 when you close the menu the view returns to the top of the page


 I have a working (non-working?) example on my website if this explanation
 is not clear enough. I noticed that when you click the link in mobile it
 actually scrolls to the proper place, but when you close the menu it
 returns to the top of the page. I did this by setting background: none; on
 the menu div and testing it.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/56274>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list