From 036e4f66b801a3e4c73f4dd8419d858a12cc4ac5 Mon Sep 17 00:00:00 2001 From: Steven Orvell Date: Fri, 4 May 2018 16:24:41 -0700 Subject: [PATCH] Fix for browsers that don't have input.labels. --- lib/utils/gestures.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/utils/gestures.js b/lib/utils/gestures.js index 3a87b953d1..c195032a1b 100644 --- a/lib/utils/gestures.js +++ b/lib/utils/gestures.js @@ -125,7 +125,7 @@ function canBeLabelled(el) { * @return {!Array} Relevant label for `el` */ function matchingLabels(el) { - let labels = Array.prototype.slice.call(/** @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,