简体   繁体   中英

HTML + RoR dropdown not clickable on mobile

      <div class="dropdown pull-right">
        <a id="dropdown" data-toggle="dropdown" aria-haspopup="false" aria-expanded="true">
          <%= theme_icon_tag "settings" %>
        </a>
        <ul class="dropdown-menu" aria-labelledby="dropdown" style="padding: 0.25em">
          <li><%= link_to "Edit", edit_book_review_path(review.book, review), class: "btn btn-outline-primary dropdown-item" %></li>
          <li><%= link_to "Delete", book_review_path(review.book, review), method: :delete, data: {confirm: "Are you sure?"}, class: "btn btn-outline-danger dropdown-item" %></li>
        </ul>
      </div>
    <% end %>
  <% end %>
</div>

This is my dropdown and it's working fine on desktop. Ive got my phone laying around and wanted to test it's functionality and I realized that I am not able to click the icon to open the dropdown-menu.

Why is that?

This link will help you stackoverflow.com/a/17841690/6392696

Find this file bootstrap.min.js , In substring

"ontouchstart"

Replace it with

"disable-ontouchstart"

Hopefully this will help!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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