material-components / material-components-web-react

Material Components for React (MDC React)
MIT License
2.02k stars 227 forks source link

Switch in Dialog renders large ripple #719

Open MatthiasF999 opened 5 years ago

MatthiasF999 commented 5 years ago

When I add a Switch to a Dialog, the ::before element is huge. dialogwithswitch

I believe this is because the switch is initialized inside a closed dialog, but this behavior does not occur when using the material-components-web (example here: https://codepen.io/matthiasf999/pen/qvRomz).

mgr34 commented 5 years ago

I believe I had a similiar issue #657. I offered a work around that maybe relevant to you until these issues are resolved.

moog16 commented 5 years ago

@mgr34 yup this sounds like an issue from MDC Web about a year ago. I think we added layout then. Fix is similar to #657: to add a layout method in the ripple/index.tsx on an update.

MatthiasF999 commented 5 years ago

The MDC Web version does not contain a layout method. That was the first thing I looked for. The work around does not help either.

moog16 commented 5 years ago

The layout method needs to be called on the ripple method.