Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

contextMenuItem Download SVG #31

Open
mipmip opened this issue May 19, 2022 · 0 comments
Open

contextMenuItem Download SVG #31

mipmip opened this issue May 19, 2022 · 0 comments

Comments

@mipmip
Copy link
Member

mipmip commented May 19, 2022

this does not download but opens a new tab with the SVG:

      const a = document.createElement('a');
      a.href = this.state.componentBaseUrl + "/" + this.state.contextMenu.component;
      a.setAttribute(
        'download',
        'file.svg',
      );
      //a.download = this.state.contextMenu.component;
      document.body.appendChild(a); // we need to append the element to the dom -> otherwise it will not work in firefox
      a.click();
      a.remove();  //afterwards we remove the element again
@mipmip mipmip moved this from Next Versions to Todo in SVG Stencils v3 May 24, 2022
@mipmip mipmip moved this from Todo to In Progress in SVG Stencils v3 May 24, 2022
@mipmip mipmip moved this from In Progress to Next Versions in SVG Stencils v3 May 24, 2022
@mipmip mipmip removed this from SVG Stencils v3 May 26, 2022
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant