[wp-trac] [WordPress Trac] #52296: foreach not working on safari ipad ios9

WordPress Trac noreply at wordpress.org
Thu Jan 14 11:13:26 UTC 2021


#52296: foreach not working on safari ipad ios9
---------------------------------+-----------------------------
 Reporter:  wishboneproductions  |      Owner:  (none)
     Type:  defect (bug)         |     Status:  new
 Priority:  normal               |  Milestone:  Awaiting Review
Component:  Menus                |    Version:  5.6
 Severity:  minor                |   Keywords:  needs-patch
  Focuses:  javascript           |
---------------------------------+-----------------------------
 script: /assets/primary-navigation.js
 browser: safari (ipad iOS 9.3.5)
 bug: older safari browsers not supporting nodelist for forEach they need
 an Array

 Problem:
 el.closest( 'nav' ).querySelectorAll( '.sub-menu-toggle' ).forEach(
 function( button ) {

 Solution:
 Array.from(menu_dom.querySelectorAll( '.menu-wrapper > .menu-item-has-
 children' )).forEach( function( li ) {

 Notes:
 should be replaced a couple of times throughout the file

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


More information about the wp-trac mailing list