Skip to content

Commit

Permalink
Fix for browsers that don't have input.labels.
Browse files Browse the repository at this point in the history
  • Loading branch information
Steven Orvell committed May 4, 2018
1 parent 2ce4f70 commit 036e4f6
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 = 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,
Expand Down

0 comments on commit 036e4f6

Please sign in to comment.