Skip to content

Commit

Permalink
Move input id in Markdown ToggleTab to variable
Browse files Browse the repository at this point in the history
  • Loading branch information
julieg18 committed Sep 29, 2021
1 parent 5310591 commit 584456c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/components/pages/Documentation/Markdown/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -128,16 +128,18 @@ const ToggleTab: React.FC<{
onChange: () => void
checked: boolean
}> = ({ children, id, checked, ind, onChange, title }) => {
const inputId = `tab-${id}-${ind}`

return (
<>
<input
id={`tab-${id}-${ind}`}
id={inputId}
type="radio"
name={`toggle-${id}`}
onChange={onChange}
checked={checked}
/>
<label className={styles.tabHeading} htmlFor={`tab-${id}-${ind}`}>
<label className={styles.tabHeading} htmlFor={inputId}>
{title}
</label>
{children}
Expand Down

0 comments on commit 584456c

Please sign in to comment.