Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion packages/ui-checkbox/src/Checkbox/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,18 @@ class Checkbox extends Component<CheckboxProps, CheckboxState> {
onBlur={createChainedFunction(onBlur, this.handleBlur)}
checked={this.checked}
/>
<label htmlFor={this.id} css={styles?.control}>
{/* Prevent the browser from firing a blur on the hidden input during
mousedown on the label, which would cause Focusable to lose focus
before the click event is processed. Manually restore focus instead. */}
<label
htmlFor={this.id}
css={styles?.control}
/* eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions */
onMouseDown={(e) => {
e.preventDefault()
this._input?.focus()
}}
>
{this.renderFacade()}
{this.renderMessages()}
</label>
Expand Down