Skip to content

Commit

Permalink
fix(StepIndicator): fix item click event forwarding
Browse files Browse the repository at this point in the history
  • Loading branch information
tujoworker committed Nov 3, 2021
1 parent 74abbe5 commit 22fa411
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ export default class StepIndicatorItem extends React.PureComponent {
// Deprecated
isTrue(this.context.use_navigation)
) {
buttonParams.onClick = (event) =>
buttonParams.onClick = ({ event }) =>
this.onClickHandler({
event,
item: this.props,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,10 @@ describe('StepIndicator in loose mode', () => {
items.at(0).find('button').simulate('click')

expect(on_change).toBeCalledTimes(1)
expect(on_change.mock.calls[0][0].currentStep).toBe(0)
expect(typeof on_change.mock.calls[0][0].event.preventDefault).toBe(
'function'
)
expect(
items
.at(0)
Expand Down

0 comments on commit 22fa411

Please sign in to comment.