Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

fix: Use callback for toBlob in clipboard write example #33000

Merged
merged 6 commits into from May 3, 2024

Conversation

bsmth
Copy link
Member

@bsmth bsmth commented Apr 8, 2024

Description

This PR fixes the example to use a callback in toBlob(). I'm not adding more elements like an <output> or adding image back to DOM as I think it overcomplicates things here.

I can confirm that this copies the image to clipboard, see the following codepen: https://codepen.io/bsmth/pen/OJGvoLV

Fixes #32385

@bsmth bsmth requested a review from a team as a code owner April 8, 2024 16:14
@bsmth bsmth requested review from wbamberg and removed request for a team April 8, 2024 16:14
@github-actions github-actions bot added Content:WebAPI Web API docs size/s 6-50 LoC changed labels Apr 8, 2024
Copy link
Contributor

github-actions bot commented Apr 8, 2024

Preview URLs

(comment last updated: 2024-05-03 14:00:48)

@wbamberg
Copy link
Collaborator

wbamberg commented Apr 8, 2024

I haven't reviewed this properly yet, but I will. However, what do you think about making this into a live sample? As I read the issue, this example was completely broken before, but it got through review (my review in fact) because it wasn't a live sample.

@bsmth
Copy link
Member Author

bsmth commented Apr 9, 2024

what do you think about making this into a live sample?

It would definitely be more interesting, let's do that. I'll give it a shot shortly.

@bsmth bsmth self-assigned this May 3, 2024
@github-actions github-actions bot added size/m 51-500 LoC changed and removed size/s 6-50 LoC changed labels May 3, 2024
Copy link
Collaborator

@wbamberg wbamberg left a comment

Choose a reason for hiding this comment

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

👍 thank you!

@wbamberg wbamberg merged commit 477066a into mdn:main May 3, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content:WebAPI Web API docs size/m 51-500 LoC changed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Code snippet using the void return of canvas toBlob() function
3 participants