Add tabIndex prop in checkbox
Signed-off-by: Ajay Bura <ajbura@gmail.com>
This commit is contained in:
parent
44544f3289
commit
f8e2d27bb0
1 changed files with 5 additions and 1 deletions
|
@ -3,7 +3,8 @@ import PropTypes from 'prop-types';
|
|||
import './Checkbox.scss';
|
||||
|
||||
function Checkbox({
|
||||
variant, isActive, onToggle, disabled,
|
||||
variant, isActive, onToggle,
|
||||
disabled, tabIndex,
|
||||
}) {
|
||||
const className = `checkbox checkbox-${variant}${isActive ? ' checkbox--active' : ''}`;
|
||||
if (onToggle === null) return <span className={className} />;
|
||||
|
@ -14,6 +15,7 @@ function Checkbox({
|
|||
className={className}
|
||||
type="button"
|
||||
disabled={disabled}
|
||||
tabIndex={tabIndex}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
@ -23,6 +25,7 @@ Checkbox.defaultProps = {
|
|||
isActive: false,
|
||||
onToggle: null,
|
||||
disabled: false,
|
||||
tabIndex: 0,
|
||||
};
|
||||
|
||||
Checkbox.propTypes = {
|
||||
|
@ -30,6 +33,7 @@ Checkbox.propTypes = {
|
|||
isActive: PropTypes.bool,
|
||||
onToggle: PropTypes.func,
|
||||
disabled: PropTypes.bool,
|
||||
tabIndex: PropTypes.number,
|
||||
};
|
||||
|
||||
export default Checkbox;
|
||||
|
|
Loading…
Reference in a new issue