From f8e2d27bb031e4196c195f6de1169f944fe004bf Mon Sep 17 00:00:00 2001 From: Ajay Bura Date: Sun, 20 Feb 2022 20:14:28 +0530 Subject: [PATCH] Add tabIndex prop in checkbox Signed-off-by: Ajay Bura --- src/app/atoms/button/Checkbox.jsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/app/atoms/button/Checkbox.jsx b/src/app/atoms/button/Checkbox.jsx index 5079a40..7fcea3b 100644 --- a/src/app/atoms/button/Checkbox.jsx +++ b/src/app/atoms/button/Checkbox.jsx @@ -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 ; @@ -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;