global Ctrl + v to paste images
Closed this issue · 3 comments
Is your feature request related to a problem? Please describe.
Currently, there's no way to handle global Ctrl + v
to paste images directly into the upload area. This feature would simplify workflows where users want to quickly upload images copied from other sources.
Describe the solution you'd like
Support a global event listener for Ctrl + v
that triggers the image upload process when an image is detected in the clipboard. This should work even if the upload area is not focused, providing a seamless user experience.
Describe alternatives you've considered
An alternative would be to implement a custom solution using window.addEventListener
for paste
events, but it would be more efficient and consistent if this feature were supported natively in the library.
Additional context
Adding this feature would make the library more user-friendly for scenarios involving frequent image uploads, such as in chat applications or content management systems.
hey @denvey
if you look at line 4 (in the first image you added), in case element isnt provided, the window becomes the target.
so doing this:
usePasteUpload(null, null, onPasteUpload);
would make the Window/Global become the paste target.
Wouldn't that provide the capability you're looking for?
thanks! I will fix the typing