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

WordPress Trac noreply at wordpress.org
Mon Dec 16 14:22:29 UTC 2019


#48916: Twenty Twenty: anchor links don't work in mobile menu
---------------------------+-----------------------------
 Reporter:  Giorgio25b     |       Owner:  (none)
     Type:  defect (bug)   |      Status:  new
 Priority:  normal         |   Milestone:  Future Release
Component:  Bundled Theme  |     Version:  5.3
 Severity:  normal         |  Resolution:
 Keywords:  needs-patch    |     Focuses:  javascript
---------------------------+-----------------------------

Comment (by suzylah):

 I also have this issue – one-pager website with the main navigation all
 linking to #anchors within the page. The problem is, they DO actually work
 (smooth scroll), but only on the second click. In fact, even if the second
 click is yet on another link, it then scrolls to the previous one.
 Example (when performed in this order):
 1) Click link #A – Scrolls to #A as expected.
 2) Click link #B – nothing happens
 3) Click link #C – scrolls to #B
 4) Click link #D – scrolls to #C
 5) Click link #B, scrolls to #D
 And so on...
 It appears as if the target is just saved on first click, and acted upon
 on the next click – but I couldn't find the place in the code yet where
 this happens.

 PS. In the mobile menu, there was a second (CSS) issue on top, the html
 element gets the inline styles {overflow-y: scroll;position: fixed; ...
 etc...} set when menu opens, which fixes the whole window and nothing seem
 to happen on click.
 I solved it with a quick&dirty html {position:
 static!important;overflow-y: unset!important;}

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


More information about the wp-trac mailing list