materialize icon indicating copy to clipboard operation
materialize copied to clipboard

Modal does not work if parent div has CSS transform!

Open vpezeshkian opened this issue 10 years ago • 5 comments

Hi guys,

The modal dos not seems to handle properly if parents (not immediate) has transform in style. As soon as I uncheck transform: translate(10px, 10px); in dev tools, modal appears...

here's a screenshot.

It's impossible to get rid of that transform since it plays key role in my code.

Any suggestion? Thanks.

screen shot 2016-07-25 at 10 27 12 am

vpezeshkian avatar Jul 25 '16 17:07 vpezeshkian

Can you move the actual modal out of the parent and just keep the trigger there? http://codepen.io/anon/pen/jAxQwK

Thanood avatar Jul 25 '16 17:07 Thanood

Hmm yes, it's possible, and I tried it and it's working properly, but I have problem with this approach... The black area you see in the screenshot is my React component, which has a modal for settings. I have methods/styles bound to the modal which makes it not easy to do. I'm trying to create stand-alone and not dependable components...

vpezeshkian avatar Jul 25 '16 18:07 vpezeshkian

The issue is this

Anyone can suggest a workaround?

vpezeshkian avatar Jul 26 '16 04:07 vpezeshkian

It's because CSS transforms introduces new coordinates for the component.

vpezeshkian avatar Aug 05 '16 20:08 vpezeshkian

@vpezeshkian Please provide a codepen to understand exactly what's happening

thanks.

Closed due inactivity, feel free to reopen it if it is still necessary.

fega avatar Apr 19 '17 14:04 fega