Skip to content

Commit

Permalink
fix: pass event to user-supplied inputProps {onClick}
Browse files Browse the repository at this point in the history
  • Loading branch information
Hunter McMillen authored and rolandjitsu committed Oct 13, 2018
1 parent b6aab86 commit fd99719
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/index.js
Expand Up @@ -264,7 +264,7 @@ class Dropzone extends React.Component {
onInputElementClick(evt) {
evt.stopPropagation()
if (this.props.inputProps && this.props.inputProps.onClick) {
this.props.inputProps.onClick()
this.props.inputProps.onClick(evt)
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/index.spec.js
Expand Up @@ -296,7 +296,7 @@ describe('Dropzone', () => {
const component = mount(<Dropzone inputProps={{ onClick }} />)

component.simulate('click')
expect(onClick).toHaveBeenCalled()
expect(onClick).toHaveBeenCalledWith(expect.any(MouseEvent))
})
})

Expand Down

0 comments on commit fd99719

Please sign in to comment.