title: Materialize CSS - Collapsible
body: <p>I'm working with Materialize CSS and using the collapsible accordion-style element ( <a href="http://materializecss.com/collapsible.html" rel="nofollow">http://materializecss.com/collapsible.html</a> ).</p>
  
  <p>For some reason, as soon as I click to open an item, it immediately closes.</p>
  
  <p>Here is my code.  My goal is simply to be able to use collapsible as intended (i.e. with the element opening and remaining open).</p>
  
  <pre><code>&lt;div style="width:600px; margin:0 auto;"&gt;
      &lt;ul class="collapsible" data-collapsible="accordion"&gt;
  
      &lt;% @friends.each do |friend| %&gt;
          &lt;li&gt;
          &lt;% latestTweet = CLIENT.user_timeline(friend.twitterHandle)[0] %&gt;
            &lt;div class="collapsible-header"&gt;
  
              &lt;img src="&lt;%= latestTweet.user.profile_image_url %&gt;" width="40" height="40"&gt;&lt;%= link_to friend.firstName + " (" + friend.twitterHandle + ")", "friends/" + friend.id.to_s  %&gt;&lt;div style="float:right"&gt;&lt;%= (Indico.sentiment(latestTweet.text)*100).round %&gt;&lt;/div&gt;
            &lt;/div&gt;
            &lt;div class="collapsible-body"&gt;
              &lt;p&gt;
                  &lt;%= latestTweet.text %&gt;
              &lt;/p&gt;
            &lt;/div&gt;
          &lt;/li&gt;
          &lt;% end %&gt;
      &lt;/ul&gt;
      &lt;/div&gt;
  </code></pre>