We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6e21748 commit 4abc8eaCopy full SHA for 4abc8ea
examples/simple.js
@@ -13,6 +13,7 @@ const ControlSteps = () => {
13
<Steps
14
current={current}
15
onChange={(val) => {
16
+ console.log('Change:', val);
17
setCurrent(val);
18
}}
19
>
package.json
@@ -1,6 +1,6 @@
1
{
2
"name": "rc-steps",
3
- "version": "3.4.0",
+ "version": "3.4.1",
4
"description": "steps ui component for react",
5
"keywords": [
6
"react",
src/Steps.jsx
@@ -68,10 +68,10 @@ export default class Steps extends Component {
68
}
69
70
71
- onStepClick = (current) => {
72
- const { onChange } = this.props;
73
- if (onChange) {
74
- onChange(current);
+ onStepClick = (next) => {
+ const { onChange, current } = this.props;
+ if (onChange && current !== next) {
+ onChange(next);
75
76
};
77
0 commit comments