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