From 3bdf29bb47dbd263b90d7f22d3b68f14880df623 Mon Sep 17 00:00:00 2001 From: Taylor Jones Date: Thu, 9 Dec 2021 14:27:11 -0600 Subject: [PATCH] Revert "feat(checkbox): add onClick prop (#9827)" This reverts commit dd1d0373462c166874ba26814ff251f90fb85496. --- .../__snapshots__/PublicAPI-test.js.snap | 4 ---- .../src/components/Checkbox/Checkbox-story.js | 1 - .../react/src/components/Checkbox/Checkbox.js | 20 +------------------ 3 files changed, 1 insertion(+), 24 deletions(-) diff --git a/packages/react/__tests__/__snapshots__/PublicAPI-test.js.snap b/packages/react/__tests__/__snapshots__/PublicAPI-test.js.snap index 29e416cc166e..b2b7a2d617c2 100644 --- a/packages/react/__tests__/__snapshots__/PublicAPI-test.js.snap +++ b/packages/react/__tests__/__snapshots__/PublicAPI-test.js.snap @@ -318,7 +318,6 @@ Map { "defaultProps": Object { "indeterminate": false, "onChange": [Function], - "onClick": [Function], }, "propTypes": Object { "checked": Object { @@ -350,9 +349,6 @@ Map { "onChange": Object { "type": "func", }, - "onClick": Object { - "type": "func", - }, "title": Object { "type": "string", }, diff --git a/packages/react/src/components/Checkbox/Checkbox-story.js b/packages/react/src/components/Checkbox/Checkbox-story.js index bbe5d165127f..212a62f762fa 100644 --- a/packages/react/src/components/Checkbox/Checkbox-story.js +++ b/packages/react/src/components/Checkbox/Checkbox-story.js @@ -102,7 +102,6 @@ const props = () => ({ hideLabel: boolean('No label (hideLabel)', false), wrapperClassName: text('Wrapper CSS class name (wrapperClassName)', ''), onChange: action('onChange'), - onClick: action('onClick'), }); export const playground = () => ( diff --git a/packages/react/src/components/Checkbox/Checkbox.js b/packages/react/src/components/Checkbox/Checkbox.js index 866239d26d51..b1c7ae13f8ed 100644 --- a/packages/react/src/components/Checkbox/Checkbox.js +++ b/packages/react/src/components/Checkbox/Checkbox.js @@ -19,7 +19,6 @@ const Checkbox = React.forwardRef(function Checkbox( id, labelText, onChange, - onClick, indeterminate, hideLabel, wrapperClassName, @@ -45,15 +44,7 @@ const Checkbox = React.forwardRef(function Checkbox( ); return ( - /* - The a11y rules below are disabled because
element has checkbox - input and label elements as children that allows keyboard interaction. - The onClick handler facilitates consumers' ability to stop click events - from bubbling beyond the checkbox without having to implement their own - wrapper element around . - */ - /* eslint-disable-next-line jsx-a11y/no-static-element-interactions, jsx-a11y/click-events-have-key-events */ -
onClick(evt)}> +
node for the Checkbox */ @@ -156,7 +139,6 @@ Checkbox.propTypes = { Checkbox.defaultProps = { onChange: () => {}, - onClick: () => {}, indeterminate: false, };