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.
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:
If i use the same modal without carousel, it works fine as expected. I am attaching a screenshot for the reference.