@@ -24,6 +24,7 @@ export default class Step extends React.Component {
2424 PropTypes . string ,
2525 ] ) ,
2626 stepNumber : PropTypes . string ,
27+ stepIndex : PropTypes . number ,
2728 description : PropTypes . any ,
2829 title : PropTypes . any ,
2930 progressDot : PropTypes . oneOfType ( [
@@ -35,7 +36,20 @@ export default class Step extends React.Component {
3536 finish : PropTypes . node ,
3637 error : PropTypes . node ,
3738 } ) ,
39+ onClick : PropTypes . func ,
40+ onStepClick : PropTypes . func ,
3841 } ;
42+
43+ onClick = ( ...args ) => {
44+ const { onClick, onStepClick, stepIndex } = this . props ;
45+
46+ if ( onClick ) {
47+ onClick ( ...args ) ;
48+ }
49+
50+ onStepClick ( stepIndex ) ;
51+ } ;
52+
3953 renderIconNode ( ) {
4054 const {
4155 prefixCls, progressDot, stepNumber, status, title, description, icon,
@@ -79,7 +93,7 @@ export default class Step extends React.Component {
7993 status = 'wait' , iconPrefix, icon, wrapperStyle,
8094 adjustMarginRight, stepNumber,
8195 description, title, progressDot, tailContent,
82- icons,
96+ icons, stepIndex , onStepClick , onClick ,
8397 ...restProps ,
8498 } = this . props ;
8599
@@ -96,8 +110,18 @@ export default class Step extends React.Component {
96110 if ( adjustMarginRight ) {
97111 stepItemStyle . marginRight = adjustMarginRight ;
98112 }
113+
114+ const accessibilityProps = { } ;
115+ if ( onStepClick ) {
116+ accessibilityProps . role = 'button' ;
117+ accessibilityProps . tabIndex = 0 ;
118+ accessibilityProps . onClick = this . onClick ;
119+ }
120+
99121 return (
100122 < div
123+ onClick = { onClick }
124+ { ...accessibilityProps }
101125 { ...restProps }
102126 className = { classString }
103127 style = { stepItemStyle }
0 commit comments