Skip to content

Commit

Permalink
Merge pull request #1 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 0d9de21 + 2235403 commit c93e310
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 @@ -367,7 +367,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 c93e310

Please sign in to comment.