Skip to content

Commit

Permalink
fix: make toggle wrapper id different from checkbox
Browse files Browse the repository at this point in the history
affects: @medly-components/core
  • Loading branch information
gmukul01 committed May 13, 2024
1 parent 9dc88bd commit 6458570
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true,
"source.organizeImports": true,
"source.fixAll.stylelint": true
"source.fixAll.eslint": "explicit",
"source.organizeImports": "explicit",
"source.fixAll.stylelint": "explicit"
},
"eslint.validate": ["html", "javascript", "javascriptreact", "typescript", "typescriptreact"],
"cSpell.words": ["Medly"],
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/components/Toggle/Toggle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const Component: FC<ToggleProps> = memo(
toggleId = useMemo(() => id || label?.toLocaleLowerCase().replace(/ +/g, '-') || 'medly-toggle-checkbox', [id, label]);

return (
<FieldWithLabel id={toggleId} fieldWithMaxContent {...{ fullWidth, labelPosition }}>
<FieldWithLabel id={`${toggleId}-wrapper`} fieldWithMaxContent {...{ fullWidth, labelPosition }}>
{label && (
<FieldWithLabel.Label
showPointer={!restProps.disabled}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ exports[`Toggle component should render correctly with all the default props 1`]
<div>
<div
class="c0"
id="medly-toggle-checkbox"
id="medly-toggle-checkbox-wrapper"
>
<div
Expand Down Expand Up @@ -300,7 +300,7 @@ exports[`Toggle component should render correctly with all the props given 1`] =
<div>
<div
class="c0"
id="gender-toggle"
id="gender-toggle-wrapper"
>
<label
class="c1 c2"
Expand Down

0 comments on commit 6458570

Please sign in to comment.