question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How about remove the Label warpper for Switch?

See original GitHub issue

If we want to to let the label be before of the switch, we need:

<Flex
  sx={{
    justifyContent: 'space-between',
    alignItems: 'center',
    py: 4,
  }}>
  <Label htmlFor="enable-email-alerts" sx={{ flex: 1 }}>
    Enable email alerts?
  </Label>
  <Box>
    <Switch id="enable-email-alerts" />
  </Box>
</Flex>

But I find that Switch is already a Label element. Why? I think this will be better:

<Label sx={{
    display: 'flex',
    justifyContent: 'space-between',
    alignItems: 'center',
    py: 4,
  }}>
  <span>Enable email alerts?</span>
  <Switch /> {/* A React.Fragment but not label element */}
</Label>

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:20 (20 by maintainers)

github_iconTop GitHub Comments

2reactions
PeterlitsZocommented, Feb 11, 2022

image

How about this? I also update index.d.ts for type. (By the way, a stupid question – why we do not just use ts rather than js?)

I’m 20 now!

I’m also 20!

1reaction
PeterlitsZocommented, Feb 11, 2022

By the way, do you think that we can change the inner div’s color rather than white is a better idea?

Not sure what you mean by this

I mean, the switch for show have two div: the outer div, and the inner div. The inner div is a circle, which it’s color is always white. Well, now I do not think that change it to another is a good idea. Those who want to change color may use CSS rule to change it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to remove stickers and price tags of Switch cases? - Reddit
Tape is all you need. Just peel of the tag and use tape on the residue. Its surprisingly effective.
Read more >
Removing a Skin from a Nintendo Switch Won't damage it?
Removal Of a Skin on my own Nintendo SwitchShowing the skins remove fine and cause no damage. This Skins has been on for...
Read more >
How to Package a Repair - Nintendo Support
If you are sending a system, wrap it in clear kitchen cling wrap prior to packaging. Unless the repair requires additional items, remove...
Read more >
3 Ways to Remove Clothing Labels - wikiHow
1. Cut the label out as close to the seam as you can. Use a sharp pair of scissors for this and take...
Read more >
How To Remove Labels & Sticker Residue
Method 5: Label Removal Sprays & Chemicals​​ Liberally spray Goo Gone on the label then lay a cloth/paper towel over the top. Let...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found