mkhairi / materialize-sass

Materializecss rubygem for Rails Asset Pipeline / Sprockets
http://materialize.labs.my/
MIT License
805 stars 243 forks source link

Modals lost its z-index when used in carousel #111

Closed Bilkhaan closed 6 years ago

Bilkhaan commented 8 years ago

I am using Materializecss in my ruby on rails project. I tried to use modals in carousel. The carousel seems to work fine but as i click on a image to open the modal. It doesn't retain its z-index. The black layout covers the whole screen. Here is my code:

<div class="carousel">
  <% examples.each_with_index do |example,index| %>
    <a class="carousel-item modal-trigger" href="#example-video-<%= index %>">
      <%= image_tag vimeo_api(VideoInfo.new("#{example.video}").video_id, "thumbnail_url_with_play_button"), class: 'responsive-img' %>
    </a>
    <div id="example-video-<%= index %>" class="modal">
      <div class="modal-content">
        <div>
          <%= vimeo_api(VideoInfo.new("#{example.video}").video_id, "html").html_safe %>
        </div>
      </div>
    </div>
  <% end %>
</div>

If i use the same modal without carousel, it works fine as expected. I am attaching a screenshot for the reference.

screen shot 2016-09-05 at 10 47 26 am
mkhairi commented 6 years ago

try check with latest release of materializecss. closing old issue.