[wp-trac] [WordPress Trac] #52006: Twenty Twenty-One: anchor links don't work in mobile menu

WordPress Trac noreply at wordpress.org
Thu Dec 10 10:58:19 UTC 2020


#52006: Twenty Twenty-One: anchor links don't work in mobile menu
---------------------------+------------------------------
 Reporter:  macmanx        |       Owner:  (none)
     Type:  defect (bug)   |      Status:  new
 Priority:  normal         |   Milestone:  Awaiting Review
Component:  Bundled Theme  |     Version:  5.6
 Severity:  normal         |  Resolution:
 Keywords:  has-patch      |     Focuses:  javascript
---------------------------+------------------------------
Changes (by poena):

 * keywords:   => has-patch
 * focuses:   => javascript


Comment:

 I am able to reproduce the problem.

 This is an initial patch with code adapted from Twenty Twenty.
 We don't need to consider anchor links outside the menu since the
 responsive menu is full screen.

 How this was tested:

 Added a HTML widget with a target ID to the footer widget area.
 Added two anchor links to the primary menu, one as a parent menu item, and
 the second as a sub menu item.
 Reduced the browser window width and clicked on the different anchor links
 in the menu.

 Windows 10, Chrome Version 87.0.4280.88. Firefox 83.0.
 The patch still needs to be tested on a touch device.


 -The scroll to the anchor is very fast and this could perhaps be improved
 to feel more like a natural scroll.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/52006#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list