Skip to content

Commit

Permalink
update comment for stopPropagation in file input
Browse files Browse the repository at this point in the history
  • Loading branch information
miroslav committed Dec 9, 2022
1 parent b059f08 commit fee05c8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/components/AttachmentPicker/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ class AttachmentPicker extends React.Component {
this.fileInput.value = null;
}}

// Prevent parent's onclick event from firing
// We are stopping the event propagation because triggering the `click()` on the hidden input
// causes the event to unexpectedly bubble up to anything wrapping this component e.g. Pressable
onClick={e => e.stopPropagation()}
accept={getAcceptableFileTypes(this.props.type)}
/>
Expand Down

0 comments on commit fee05c8

Please sign in to comment.