简体   繁体   English

实现可折叠的内部模态不会保持打开状态

[英]Materialize collapsible inside modal doesn't remain open

I'm facing an issue with my collapsible, that make the collapsible-body to open/close several times very fast when I click on a collapsible-header element. 我遇到了可折叠主体的问题,这使可折叠主体在单击可折叠标头元素时非常快速地打开/关闭几次。

Here is the modal trigger: 这是模式触发器:

<a class="btn modal-trigger" href="#myModal">Trigger</a>

Here is my modal structure: (note the use of ng-repeat, not sure if it might be linked) 这是我的模式结构:(请注意ng-repeat的使用,不确定是否可以链接)

  <div id="myModal" class="modal">
    <div class="modal-content" >
      <ul class="collapsible" data-collapsible='accordion' watch>
        <li>
          <div class="collapsible-header">FOO</div>
          <div class="collapsible-body">foo</div>
        </li>
        <li>
          <div class="collapsible-header">BAR</div>
          <div class="collapsible-body">bar</div>
        </li>
      </ul>
    </div>
  </div>

The script ending my HTML: 结束我的HTML的脚本:

<script> 
    $(document).ready(function(){
        $('.modal-trigger').leanModal({
            ready: function(){
                $('.collapsible').collapsible()
            }
        });
    });
</script>

I've been browsing around without finding any related issue. 我一直在浏览,没有发现任何相关问题。 Any help will be much appreciated (do not hesitate to ask for clarification). 任何帮助将不胜感激(不要犹豫,要求澄清)。

Thanks Allan for your answer, Although it is not related to the height: 感谢Allan的回答,尽管这与身高无关:

  1. The modal automatically vertical-expands itselfs when item is opening. 打开项目时,模态会自动垂直扩展自身。

  2. Setting a large min-height doesn't solve my issue. 设置最低高度不能解决我的问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM