Check if pastedFile is a file before run getAsFile #16
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Received from two friends (@michel-gatti and @fpgentil) that since ~ 2 weeks ago they can't Paste Print Screens direct on inputs that uses file-attachment-element.
Both are using linux. @michel-gatti is using Mint with chrome Version 93.0.4577.82 (Official Build) (64-bit) and @fpgentil is using Fedora 34 - Gnome 40.4.0 - Kernel 5.13.14-200.fc34.x86_64 with a clipboard manager tool called flameshot
Both says that they can paste the files from screenshot in other browser apps (like Google Docs) but not on fields that uses file-attachment-element.
@michel-gatti made some tests and looks like his clipboard manager / browser is sending all these DataTransferItem when pasting
This patch on the file-attachment-element gets only the datatransferitem that is really a FILE before run getAsFile
I've tested with him and after this patch it got work again