brianblakely / nodep-date-input-polyfill

Automatically adds datepickers to input[type=date] on IE, macOS Safari, and legacy browsers.
https://www.npmjs.com/package/nodep-date-input-polyfill
MIT License
96 stars 137 forks source link

Fixing how the currentScript is captured from DOM #42

Closed lucasghizoni closed 7 years ago

lucasghizoni commented 7 years ago

As i am loading this polyfill with requirejs, in any tag script in DOM, i faced the following problem in chrome: The polifyll was just apearing when clicking in the inputs. So i saw the supportsDateInput() method and fixed how the currentScript is captured from DOM. I think that currentScript is null in some cases that you are inside a normal script tag, without src attribute. Btw, thantks for this nice polyfill!