From 1f6397ad40f83d7f948414380103aa2243b5cc41 Mon Sep 17 00:00:00 2001 From: Elio Date: Tue, 16 Feb 2021 23:39:01 -0400 Subject: [PATCH] fix: prevent default onkeypress action --- src/components/Input/Checkbox.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/Input/Checkbox.js b/src/components/Input/Checkbox.js index 9f91a8864..f72140cfa 100644 --- a/src/components/Input/Checkbox.js +++ b/src/components/Input/Checkbox.js @@ -35,7 +35,10 @@ class Checkbox extends React.PureComponent { if (checked) return 'true' return 'false' } - handleClick = () => { + handleKeyPress = e => { + e.preventDefault() + } + handleClick = e => { const { onChange, checked, indeterminate } = this.props onChange(indeterminate ? false : !checked) } @@ -95,6 +98,7 @@ class Checkbox extends React.PureComponent { tabIndex={tabIndex} aria-checked={this.getAriaChecked()} onClick={this.handleClick} + onKeyPress={this.handleKeyPress} onFocus={onFocus} disabled={disabled} css={`