diff --git a/src/common/Checkbox/Checkbox.js b/src/common/Checkbox/Checkbox.js
index db640708b..d4f8fe663 100644
--- a/src/common/Checkbox/Checkbox.js
+++ b/src/common/Checkbox/Checkbox.js
@@ -7,18 +7,10 @@ const styles = require('./styles');
const Checkbox = React.forwardRef(({ className, checked = false, disabled = false, onClick, children }, ref) => {
return (
-
-
+
- {React.isValidElement(React.Children.only(children)) ? children : null}
-
+ {React.isValidElement(children) ? children : null}
+
);
});
@@ -29,7 +21,10 @@ Checkbox.propTypes = {
checked: PropTypes.bool,
disabled: PropTypes.bool,
onClick: PropTypes.func,
- children: PropTypes.node
+ children: PropTypes.oneOfType([
+ PropTypes.arrayOf(PropTypes.node),
+ PropTypes.node
+ ])
};
module.exports = Checkbox;
diff --git a/src/common/Checkbox/styles.less b/src/common/Checkbox/styles.less
index 4d20ccdfd..8e6dc553f 100644
--- a/src/common/Checkbox/styles.less
+++ b/src/common/Checkbox/styles.less
@@ -1,7 +1,4 @@
.checkbox-container {
- position: relative;
- z-index: 0;
-
&:global(.checked) {
.icon {
padding: calc(0.1 * var(--icon-size));
@@ -15,14 +12,4 @@
fill: var(--icon-color);
background-color: var(--icon-background-color);
}
-
- .native-checkbox {
- position: absolute;
- top: 0;
- left: 0;
- width: 0;
- height: 0;
- opacity: 0;
- z-index: -1;
- }
}
\ No newline at end of file