marwinburesch / marwinburesch/react-playground

Unnecessary `id` property of the `ToggleSwitch` component

Open
#7 0 comments 0 reactions 1 assignee View on GitHub

@marwinburesch is already working on this.

Since Nov 20, 2019.

cleanup
Dominant language
JavaScript
Stars
0
Forks
0
PR merge metrics
No merged PRs in 30d

Description

Instead of using `id` and `htmlFor`, you could add the `input` as children of the `label`. I was a little bit confused by the `id` property of the `ToggleSwitch` component.

_Originally posted by @lmachens in https://github.com/marwinburesch/react-playground/pull/3_

> I sourced the `ToggleSwitch` from https://codesandbox.io/s/6v7n1vr8yn and I can't make `input` work correctly as a child of `label`. If I do it like you said functionality still works, obviously, however it won't change color and position. I am assuming this has to do with `&:checked + ${CheckBoxLabel}` in line 45, but I don't fully understand it yet. Will do research and fix it in another PR

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.