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

Can't paste a snipped image #1276

Closed
droulmegus opened this issue Feb 5, 2019 · 15 comments
Closed

Can't paste a snipped image #1276

droulmegus opened this issue Feb 5, 2019 · 15 comments
Assignees
Labels
Improvement Stale Old issues that haven't had activity recently

Comments

@droulmegus
Copy link

Hi,

We are currently implementing your library in our application and we noticed that it was possible to copy/paste an image from Windows snipping tool to the browser, except IE 11.

Is it a bug or is something not supported by uppy/ie and is there a fix, a workaround or a plan to support it?

How to reproduce

  1. Snip an image using Windows snipped tool
  2. Paste it on the uppy component

Expected behaviour

The snipped image is accepted by the component.

Additional information

It was tested based the examples provided on your website and in a create-react-app example.

Environment Version
Windows 10
Browser IE 11.523.17134.0
@arturi
Copy link
Contributor

arturi commented Feb 5, 2019

Hi! Paste support is a little flaky at times. If you enable debugging, does the console say anything about the image?

@droulmegus
Copy link
Author

Hello,
I just re-tried to be sure, but the console logs nothing even with the debugging enabled. It seems nothing is triggered when trying to paste.

@joelvh
Copy link

joelvh commented Mar 6, 2019

I found that you have to click the drop zone to give it focus and then pasting works for me (in latest Chrome). Not sure if that helps with your IE situation.

Ideally, the drop zone doesn't require clicking to give focus first - ought to capture "paste" at the window level?

@arturi
Copy link
Contributor

arturi commented Mar 7, 2019

Ideally, the drop zone doesn't require clicking to give focus first - ought to capture "paste" at the window level?

That’s right, the Dashboard is the paste target, so it has to be in focus. I’m hesitant to capture all window paste events, since there might be other things happening in the bigger site/app, which Uppy is just a part of. And by capturing everything we might unintentionally paste all sorts of stuff.

@arturi
Copy link
Contributor

arturi commented Mar 7, 2019

One of the options I was considering for the Dashboard is capturing all file drops on the window, maybe paste can be part of that option 🤔

@joelvh
Copy link

joelvh commented Mar 7, 2019

@arturi good point - an option so it’s not default makes sense to me.

A use case I’m currently solving for that brought me here yesterday is pasting into a normal textarea with markdown capability. Since we use Uppy, ideally we trigger Uppys paste upload capability, but I haven’t gotten far yet on how to trigger that without the drop zone visible. Any thoughts whether this is remotely possible? (Think GitHub issues and how you can paste screenshots right here.)

Thanks!

@arturi
Copy link
Contributor

arturi commented Mar 7, 2019

Not unless you trigger the paste event on the Dashboard element — there’s no public API for it. But it’s under consideration.

@joelvh
Copy link

joelvh commented Mar 7, 2019

Ok thanks!

@kvz
Copy link
Member

kvz commented May 29, 2019

Hi there, sorry for the long wait. We have a PR in the works that might address this issue (#1583), @lakesare can you check if pasting works in IE 11.

@lakesare
Copy link
Contributor

lakesare commented May 31, 2019

Looks like there are two issues discussed here:

  1. We are currently implementing your library in our application and we noticed that it was possible to copy/paste an image from Windows snipping tool to the browser, except IE 11.

    @rhublard, I believe there is no support for image pasting in IE11 sadly: https://caniuse.com/#search=paste. It will work in latest Chrome, Firefox, Safari and Edge though.
    Feature/make paste work when buttons are focused #1583 will just enable pastes when you're focused on some button within the Uppy instance, I don't think that's the issue discussed here.

  2. About providing the interface for image pasting into the element other than our Uppy instance, - it's pretty easy to provide some option for Dashboard, e.g. pasteTarget: '.my-editor', that will react to all paste events on .my-editor. Maybe we could add a similar dropTarget option.

@arturi, @kvz?

@kvz
Copy link
Member

kvz commented May 31, 2019

Thanks for weighing in here Evgenia! The solution you propose seems like a sane one. A new plugin for dragndrop seems like it could cause some BC headaches as we’d still also support the old way until 2.0. Perhaps if by 2.0 we feel strongly it should be its own plugin, that’s the time to pull that trigger, and until then, we can get away with these two properties?

@lakesare
Copy link
Contributor

@kvz, just noticed @joelvh wants these options for the DragDrop instead of the Dashboard (makes sense).
Then right, it's probably better left up to the new DragDrop component, maybe with pasteTarget as the intermediate solution if we really need it.

@arturi
Copy link
Contributor

arturi commented May 31, 2019

I think a future separate DropPasteTarget plugin solves these issues, and I think it’s better as standalone thing, because then it can be used with any other plugin, or on it’s on, and it will be lightweight, without any rendering stuff.

I considered an option to the Dashboard, but this plugin would supersede that option, we probably shouldn’t duplicate functionality like that.

@stale
Copy link

stale bot commented Jan 18, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the Stale Old issues that haven't had activity recently label Jan 18, 2021
@stale stale bot closed this as completed Feb 1, 2021
@joelvh
Copy link

joelvh commented Feb 2, 2021

@lakesare Is this solved by #1619? I haven't had a chance to test it myself. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Improvement Stale Old issues that haven't had activity recently
Projects
None yet
Development

No branches or pull requests

5 participants