mirror of
https://github.com/encounter/react-add-to-calendar.git
synced 2026-07-10 21:18:44 -07:00
fixing bug in IE where link is throwing an error
This commit is contained in:
+1
-1
@@ -2,7 +2,7 @@
|
||||
"author": "Jason Salzman",
|
||||
"name": "react-add-to-calendar",
|
||||
"description": "A simple and reusable add to calendar button component for React",
|
||||
"version": "0.0.11",
|
||||
"version": "0.0.12",
|
||||
"license": "MIT",
|
||||
"homepage": "https://github.com/jasonsalzman/react-add-to-calendar",
|
||||
"repository": {
|
||||
|
||||
@@ -19,6 +19,14 @@ export default class ReactAddToCalendar extends React.Component {
|
||||
}
|
||||
|
||||
componentWillMount() {
|
||||
// polyfill for startsWith to fix IE bug
|
||||
if (!String.prototype.startsWith) {
|
||||
String.prototype.startsWith = function(searchString, position) {
|
||||
position = position || 0;
|
||||
return this.indexOf(searchString, position) === position;
|
||||
};
|
||||
}
|
||||
|
||||
let isCrappyIE = false;
|
||||
if (typeof window !== 'undefined' && window.navigator.msSaveOrOpenBlob && window.Blob) {
|
||||
isCrappyIE = true;
|
||||
|
||||
Reference in New Issue
Block a user