[wp-trac] [WordPress Trac] #52296: Twenty Twenty-One: primary-navigation's forEach not working on safari ipad ios9

WordPress Trac noreply at wordpress.org
Thu Jan 14 17:17:25 UTC 2021


#52296: Twenty Twenty-One: primary-navigation's forEach not working on safari ipad
ios9
---------------------------------+------------------------------
 Reporter:  wishboneproductions  |       Owner:  (none)
     Type:  defect (bug)         |      Status:  new
 Priority:  normal               |   Milestone:  Awaiting Review
Component:  Bundled Theme        |     Version:  5.6
 Severity:  minor                |  Resolution:
 Keywords:  reporter-feedback    |     Focuses:  javascript
---------------------------------+------------------------------
Changes (by hellofromTonya):

 * keywords:  needs-patch => reporter-feedback


Comment:

 Hello @wishboneproductions,

 Welcome to WordPress Core Trac! Thank you for the ticket.

 Twenty Twenty-One theme does include a [https://github.com/WordPress
 /wordpress-develop/blob/a78715e224d458057294c8534e70a8b65444d660/src/wp-
 content/themes/twentytwentyone/assets/js/polyfills.js#L29-L42 polyfill]
 for both `closest()` and `NodeList` with `forEach`.

 There was a problem with loading the polyfills as noted in #52098 which
 was fixed in v1.1. @wishboneproductions Are you using version 1.1 for the
 Twenty Twenty-One theme?

 The code and changeset [changeset:"49865" 49865] specifically reference
 IE11. However, if I'm reading the code correctly, the polyfills should
 apply for browsers that do not support `closests()` nor `forEach` for
 `NodeList`.

 For reference, here's the support for Safari iOS:

 - `closest` https://caniuse.com/element-closest
 - `forEach` for `NodeList` https://caniuse.com/mdn-api_nodelist_foreach

 Neither is supported for Safari iOS less than version 10.


 For the proposed solution of using `Array.from()`, it is not supported
 many older browsers including IE 11 and early https://caniuse.com/mdn-
 javascript_builtins_array_from.

 👉With all of that said, @wishboneproductions please confirm the theme
 version you're using. If on 1.0, does it resolve when upgrading to 1.1?

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


More information about the wp-trac mailing list