fix: switch tabIndex not work
parent
c9f1c26693
commit
0a419dac6a
|
@ -18,7 +18,7 @@ const Switch = {
|
|||
disabled: PropTypes.bool,
|
||||
checkedChildren: PropTypes.any,
|
||||
unCheckedChildren: PropTypes.any,
|
||||
tabIndex: PropTypes.number,
|
||||
tabIndex: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
||||
checked: PropTypes.bool,
|
||||
defaultChecked: PropTypes.bool,
|
||||
autoFocus: PropTypes.bool,
|
||||
|
|
|
@ -8,7 +8,7 @@ export const switchPropTypes = {
|
|||
// onChange: PropTypes.func,
|
||||
// onMouseUp: PropTypes.func,
|
||||
// onClick: PropTypes.func,
|
||||
tabIndex: PropTypes.number,
|
||||
tabIndex: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
||||
checked: PropTypes.bool.def(false),
|
||||
defaultChecked: PropTypes.bool.def(false),
|
||||
autoFocus: PropTypes.bool.def(false),
|
||||
|
|
|
@ -79,7 +79,7 @@ export default {
|
|||
},
|
||||
},
|
||||
render() {
|
||||
const { prefixCls, disabled, loadingIcon, ...restProps } = getOptionProps(this);
|
||||
const { prefixCls, disabled, loadingIcon, tabIndex, ...restProps } = getOptionProps(this);
|
||||
const checked = this.stateChecked;
|
||||
const switchClassName = {
|
||||
[prefixCls]: true,
|
||||
|
@ -99,6 +99,7 @@ export default {
|
|||
role: 'switch',
|
||||
'aria-checked': checked,
|
||||
disabled,
|
||||
tabIndex,
|
||||
},
|
||||
class: switchClassName,
|
||||
ref: 'refSwitchNode',
|
||||
|
|
Loading…
Reference in New Issue