Added null check for chrome (#3398)
This commit is contained in:
parent
59d5c3dc94
commit
498e345281
1 changed files with 2 additions and 1 deletions
|
@ -117,7 +117,8 @@ export const FileUpload: React.FunctionComponent<FileUploadProps> = ({
|
||||||
const onDropAccepted = (acceptedFiles: File[], event: DropEvent) => {
|
const onDropAccepted = (acceptedFiles: File[], event: DropEvent) => {
|
||||||
if (acceptedFiles.length > 0) {
|
if (acceptedFiles.length > 0) {
|
||||||
const fileHandle = acceptedFiles[0];
|
const fileHandle = acceptedFiles[0];
|
||||||
if (event.type === "drop") {
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
||||||
|
if (event?.type === "drop") {
|
||||||
onFileInputChange?.(event, fileHandle);
|
onFileInputChange?.(event, fileHandle);
|
||||||
}
|
}
|
||||||
if (type === fileReaderType.text || type === fileReaderType.dataURL) {
|
if (type === fileReaderType.text || type === fileReaderType.dataURL) {
|
||||||
|
|
Loading…
Reference in a new issue