-
-
Notifications
You must be signed in to change notification settings - Fork 85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Alignment issue with Switch without text #10
Comments
+1 checkbox, radio had the same problem |
@nevf @DevFelixDorn I see, I'll look into it. |
@finnhvman Thanks. text should be optional for all of these. |
@nevf @DevFelixDorn The Matter Switch, Radio, and Checkbox components rely on the same html structure, the root cause is basically the same for all these. As far as I understood it's related to the One solution I can suggest is using a Zero-Width Space as text like The other solution could be me adding What are your use cases for these controls without text? @nevf The weird focus issue is probably the browser figuring out a combined outline of all the children elements of the anchor. In case of the Switch it's the pseudo element used for the ripple that causes the irregularity. You know, the growing and fading blue circle when you switch the switch. I can't really get around this issue, because of the CSS-onliness. Although, I have to ask, why are you putting a Switch inside of an anchor? According to HTML Specification it's not permitted (and it's not good UX):
|
I need only a switch without span when I had a more complex layout which require some complex flexbox/grid. It's happened not really often but it's happened ¯_(ツ)_/¯ |
@finnhvman Ben I'm using switch and checkbox in menu and tree items where the text is not part of the switch/checkbox. Further there are areas where I just use an This screen shot shows examples of both: Would having two variations of switch/checkbox etc. be the solution, one with the text Would the latter resolve my focus issue? |
When I have a
matter-switch
without any<span>_text_</span>
the vertical position of the switch is moved way up as shown below.Using a Space for text doesn't fix this and
displays
I was actually trying to put the switch inside the button when I first saw this.
I assume checkbox's etc. have the same issue.
The text was updated successfully, but these errors were encountered: