From 8f3a024a62db2f1c2d1c7ad6321df930392346ed Mon Sep 17 00:00:00 2001 From: Justin Holdstock Date: Tue, 27 Nov 2018 13:45:59 -0600 Subject: [PATCH] Fix: Add NodeList.forEach polyfill for IE (#869) --- src/lib/polyfill.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/lib/polyfill.js b/src/lib/polyfill.js index 87585966a..e3f37f04e 100644 --- a/src/lib/polyfill.js +++ b/src/lib/polyfill.js @@ -392,4 +392,10 @@ if (!String.prototype.startsWith) { return this.substr(!pos || pos < 0 ? 0 : +pos, search.length) === search; }; } + +// NodeList.prototype.forEach polyfill for IE11 +// https://developer.mozilla.org/en-US/docs/Web/API/NodeList/forEach +if (window.NodeList && !NodeList.prototype.forEach) { + NodeList.prototype.forEach = Array.prototype.forEach; +} /* eslint-enable */