Skip to content

Remove <lg-download-button> component, it was only needed for IE#7624

Merged
zachmargolis merged 2 commits intomainfrom
margolis-remove-download-button-component
Jan 12, 2023
Merged

Remove <lg-download-button> component, it was only needed for IE#7624
zachmargolis merged 2 commits intomainfrom
margolis-remove-download-button-component

Conversation

@zachmargolis
Copy link
Contributor

@zachmargolis zachmargolis commented Jan 11, 2023

  • Now that we have dropped support for Internet Explorer, we can rely on browsers having correct support for <a href="data://"> links

- Now that we have dropped support for Internet Explorer,
  we can rely on browsers having correct support for <a href="data://>
  links
@zachmargolis zachmargolis requested a review from aduth January 11, 2023 22:27
Comment on lines -35 to -43
triggerInternetExplorerDownload = (event: MouseEvent) => {
event.preventDefault();

const filename = this.link.getAttribute('download')!;
const uri = this.link.getAttribute('href')!;
const blob = new Blob([dataURIToBlob(uri)], { type: 'text/plain' });

window.navigator.msSaveBlob?.(blob, filename);
};
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is the bulk of the logic the component did

[skip changelog]
Copy link
Contributor

@aduth aduth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good find! 👍

import '@18f/identity-download-button/download-button-element';
```

The custom element will implement the copying behavior, but all markup must already exist.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[...] will implement the copying behavior [...]

Good thing this will hide my continued copy-pasting mistakes 😅

@zachmargolis zachmargolis merged commit c90f51f into main Jan 12, 2023
@zachmargolis zachmargolis deleted the margolis-remove-download-button-component branch January 12, 2023 15:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants