Skip to content

Commit

Permalink
fix: activate cursor for React Form Toggle
Browse files Browse the repository at this point in the history
  • Loading branch information
Robbert committed May 17, 2024
1 parent e1eb79c commit c67bde3
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions components/form-toggle/css/_mixin.scss
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@
z-index: 20;
}

@mixin utrecht-form-toggle__track--html-label {
cursor: inherit;
}

@mixin utrecht-form-toggle__thumb--checked {
margin-inline-start: auto;
}
Expand Down
4 changes: 4 additions & 0 deletions components/form-toggle/css/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@
@include utrecht-form-toggle__track;
}

.utrecht-form-toggle__track--html-label {
@include utrecht-form-toggle__track--html-label;
}

.utrecht-form-toggle__track--checked {
@include utrecht-form-toggle__track--checked;
}
Expand Down
2 changes: 1 addition & 1 deletion packages/component-library-react/src/FormToggle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export const FormToggle = forwardRef(
tabIndex={tabIndex}
{...restProps}
/>
<label htmlFor={id} className="utrecht-form-toggle__track">
<label htmlFor={id} className={clsx('utrecht-form-toggle__track', 'utrecht-form-toggle__track--html-label')}>
<div className="utrecht-form-toggle__thumb"></div>
</label>
</div>
Expand Down

0 comments on commit c67bde3

Please sign in to comment.