I have a chat with textArea in which user can write text and send images. User can send image by pushing ctrl+v while textArea is focused. In "onPress" i can just do this
const {files, types} = event.clipboardData;
if (files.length > 0) {
event.preventDefault();
this.props.onPasteFile(event.clipboardData.files[0]);
return;
}
And it works fine everywhere except Firefox 96.0.3 (Win10) and latest Firefox on Linux Mint. In these browsers event.clipboardData.files is empty. However, if you do the same, but instead of textArea use div with contenteditable=true, the event.clipboardData.files array will contain the image. When dragging the image, it is also always available inside event.clipboardData.files. So my question is:
How do i get the image from clipboard in onPress event of textArea on Firefox?