Skip to content

Commit

Permalink
chore: handle more cases
Browse files Browse the repository at this point in the history
  • Loading branch information
segunadebayo committed Jan 17, 2025
1 parent ac7e777 commit c621fb6
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/machines/file-upload/src/file-upload.connect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export function connect<T extends PropTypes>(state: State, send: Send, normalize
focused,
disabled: !!disabled,
openFilePicker() {
if (disabled) return
send("OPEN")
},
deleteFile(file) {
Expand Down Expand Up @@ -90,6 +91,7 @@ export function connect<T extends PropTypes>(state: State, send: Send, normalize
send({ type: "DROPZONE.CLICK", src: "keydown" })
},
onClick(event) {
if (disabled) return
if (event.defaultPrevented) return
if (props.disableClick) return
// ensure it's the dropzone that's actually clicked
Expand Down

0 comments on commit c621fb6

Please sign in to comment.