Skip to content

Commit

Permalink
Merge pull request #2 from balajis-qb/4948--fix-fileupload-right-clic…
Browse files Browse the repository at this point in the history
…k-trigger

fix: Restrict FileUpload to trigger on left mouse click
  • Loading branch information
balajis-qb authored Sep 24, 2023
2 parents f102445 + 2235403 commit 57d99f4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion components/lib/fileupload/FileUpload.js
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,11 @@ export const FileUpload = React.memo(
allowDrop && onFileSelect(event);
};

const onSimpleUploaderClick = () => {
const onSimpleUploaderClick = (e) => {
const isLeftMouseClick = e.button === 0;

if (!isLeftMouseClick) return;

!disabled && hasFiles ? upload() : fileInputRef.current.click();
};

Expand Down

0 comments on commit 57d99f4

Please sign in to comment.