Skip to content

Commit

Permalink
gestures: Avoid spreading non-iterable in older browsers
Browse files Browse the repository at this point in the history
Instead just convert to array.
  • Loading branch information
Steven Orvell committed May 4, 2018
1 parent 503f563 commit 2ce4f70
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/utils/gestures.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ function canBeLabelled(el) {
* @return {!Array<!HTMLLabelElement>} Relevant label for `el`
*/
function matchingLabels(el) {
let labels = [...(/** @type {HTMLInputElement} */((el).labels || []))];
let labels = Array.prototype.slice.call(/** @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 2ce4f70

Please sign in to comment.