title: iOs downloading .ics file is adding a .txt extension
body: <p>I have an .ics generator which works fine on desktop but in mobile safari when downloading the .ics file a .txt extension is added to it(calendar.ics.txt).  I know it must have something to do with the data:text/calendar setting but I can't figure it out.  Any hints?:</p>
  <pre><code>export const download = (filename, text) =&gt; {
    const element = document.createElement(&quot;a&quot;);
    element.setAttribute(
      &quot;href&quot;,
      &quot;data:text/calendar;charset=utf-8,&quot; + encodeURIComponent(text)
    );
    element.setAttribute(&quot;download&quot;, filename);
    element.setAttribute(&quot;target&quot;, &quot;_blank&quot;);
    element.style.display = &quot;none&quot;;
    element.click();
  };
  </code></pre>