Skip to content

Commit

Permalink
Replace an attempt to spread a NodeList to an array with Array.from
Browse files Browse the repository at this point in the history
… for Safari 9, where NodeList is not iterable.
  • Loading branch information
bicknellr committed Jun 11, 2018
1 parent 0df1e4c commit cb40bb4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/utils/gestures.html
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@
* @return {!Array<!HTMLLabelElement>} Relevant label for `el`
*/
function matchingLabels(el) {
let labels = [...(/** @type {HTMLInputElement} */(el).labels || [])];
let labels = Array.from(/** @type {HTMLInputElement} */(el).labels || []);
// IE doesn't have `labels` and Safari doesn't populate `labels`
// if element is in a shadowroot.
// In this instance, finding the non-ancestor labels is enough,
Expand Down

0 comments on commit cb40bb4

Please sign in to comment.