Skip to content

Commit

Permalink
Merge pull request #38 from kimcoder/feature/issue-37
Browse files Browse the repository at this point in the history
[feature/issue-37] onClickNav callback argument fix
  • Loading branch information
kimcoder authored Apr 8, 2021
2 parents d435ca7 + 89757f0 commit 94bd481
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-simple-image-slider",
"version": "2.0.3",
"version": "2.0.4",
"description": "simple image slider component for react",
"main": "dist/index.js",
"scripts": {
Expand Down
5 changes: 3 additions & 2 deletions src/ImageSlider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,10 @@ const SimpleImageSlider: React.FC<SimpleImageSliderProps> = ({
if (isSliding) {
return;
}
const isRight: boolean = direction === ImageSliderNavDirection.RIGHT;

onClickNav?.(true);
slide(direction === ImageSliderNavDirection.RIGHT ? slideIdx + 1 : slideIdx - 1);
onClickNav?.(isRight);
slide(isRight ? slideIdx + 1 : slideIdx - 1);
},
[slideIdx, isSliding]
);
Expand Down

0 comments on commit 94bd481

Please sign in to comment.