Actions
Defect #36013
closedPaste image mixed with other DataTransferItem
Start date:
Due date:
% Done:
0%
Estimated time:
Resolution:
Fixed
Affected version:
Description
It's been a few months that my Chrome (now Version 94.0.4606.81) cannot paste image when creating issue (with or without any Chrome extensions). I cannot reproduce with Firefox or not even Chromium. And I cannot pinpoint the reason why this problem started, but it has been consistently reproduced for months now, across multiple Chrome updates.
This is the JS error that occurs:
attachments.js?1591235575:275 Uncaught TypeError: Cannot read properties of null (reading 'name') at HTMLDivElement.copyImageFromClipboard (attachments.js?1591235575:275) at HTMLDivElement.dispatch (jquery-2.2.4-ui-1.11.0-ujs-5.2.3.js?1581467927:3) at HTMLDivElement.r.handle (jquery-2.2.4-ui-1.11.0-ujs-5.2.3.js?1581467927:3)
This is if I console.log(item)
before the error occurs, for a single paste event:
DataTransferItem {kind: 'string', type: 'application/x-qt-image'} DataTransferItem {kind: 'string', type: 'image/bmp'} DataTransferItem {kind: 'string', type: 'image/cur'} DataTransferItem {kind: 'string', type: 'image/ico'} DataTransferItem {kind: 'string', type: 'image/jpeg'} DataTransferItem {kind: 'string', type: 'image/jpg'} DataTransferItem {kind: 'string', type: 'image/pbm'} DataTransferItem {kind: 'string', type: 'image/pgm'} DataTransferItem {kind: 'file', type: 'image/png'} <== Only item that makes sense DataTransferItem {kind: 'string', type: 'image/ppm'} DataTransferItem {kind: 'string', type: 'image/xbm'} DataTransferItem {kind: 'string', type: 'image/xpm'}
Attached is the patch to safely fix this. It applies on current git master (8075884bc48deb3b7af94799d6eba943e999dcb2), or svn r21243.
Files
Related issues
Actions