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

Support for non-text Data from the Clipboard #476

Open
scottk4106 opened this issue Nov 30, 2020 · 1 comment
Open

Support for non-text Data from the Clipboard #476

scottk4106 opened this issue Nov 30, 2020 · 1 comment
Labels
enhancement New feature or request

Comments

@scottk4106
Copy link

I am looking for a simple solution to be able to paste image data in to my Blazor app. This solution looked perfect, but I realised that it only supports text. I don't have a lot of experience with JavaScript or TypeScript, but it seems that the readText and writeText functions only provide text from the clipboard.

Have any of the contributors thought about providing support for other data such as images, using the read and write functions?
https://developer.mozilla.org/en-US/docs/Web/API/Clipboard

Thanks

@Basaingeal
Copy link
Owner

This is currently next on the list. It hasn't been a high priority as browser support is even worse for non-text Clipboard functionality, and the use-case is much rarer.

Also, Blazor's JS Interop was pretty bad at handling Blob data until .NET 6 which will be out in a couple weeks.

The ClipboardItem models which the clipboard.read() and clipboard.write() functions use is much more complicated than the text-based functionality, and requires multiple async calls to retrieve the data. Re-creating that API surface in C# will take some care.

The hope is to have non-text Data functionality in by the end of the year, but it may only be supported in .NET 6.

@Basaingeal Basaingeal added the enhancement New feature or request label Oct 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants