-
Notifications
You must be signed in to change notification settings - Fork 919
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
mwc-switch ripple is causing unwanted scrollbars (switch without text) #999
Comments
As an FYI, according to our docs there should not be a slot for switch. This aligns with MDC as well. The proper way to add a label for a switch would be with We should probably remove the slot. |
Does this issue occur when using |
@asyncLiz take a look at the results: https://stackblitz.com/edit/material-web-components-ccj5wp?file=index.js I want to get results as first two options, but not sure how to do that with
|
I was asking if you experienced the same scrollbar issue with the formfield as opposed to setting the inner text of the switch. If using formfield adds scrollbars in the wrong places, that'd be a concern. For your use case though, I would avoid the formfield entirely and set it up yourself, since you have a UX that's outside the default scope of formfield. You can add aria labels to the switch for a11y and call That will match the functionality of the formfield element. As far as alignment, it looks like that's a bug with |
I've added #1034 to track the switch alignment issue. |
@asyncLiz I'll check that and report back with the results. This is the UI I'm trying to recreate: https://material.io/components/selection-controls/#switches |
You can use the That seems like a reasonable feature request you could file on the MDC repo. A |
@asyncLiz should I also fill feature request here? |
File it on Material Components Web and mention that the feature should be added to MWC as well. You're welcome to make a second issue for more visibility on MWC 🙂 |
Any news about the slot? Will it get removed? |
Pretty sure it will be, but we haven't prioritized it specifically. In the meantime I would avoid using the slot since it's questionable whether or not it'll stick around. |
@asyncLiz any plans to release a new version? Fingers crossed 🤞 |
We should be discussing a release tomorrow, so I'd expect by the end of this week. In the meantime you can always use the |
@asyncLiz thanks for the update. Didn't know about |
Fixed in M3 |
Describe the bug
When using
mwc-switch
aligned to right it is causing unwanted vertical scrollbar.Also when used without text it causes a horizontal scrollbar to appear:
To Reproduce
Steps to reproduce the behavior:
As a workaround, I'm adding
as content.Expected behavior
the switch should have the same behavior when used with and without text.
Screenshots
Browser Version (please complete the following information):
Additional context
the switch is used by Home Assistant, more details about the error can be found here: home-assistant/frontend#5084
The text was updated successfully, but these errors were encountered: