Unpacked Twitter Bootstrap Events Don't Shoot Touch Devices

The popup panel opens and closes normally, but the click / / touch event does not fire. I put together a tiny demo test case, but its just as easy to run twitter bootsrap docs . I tried this on Android and iOS devices.

I was hoping to fix it by including an event library such as jQueryMobile or Hammer.js, but I'm not sure if this will help, since Twitter Bootstap (I think) includes its own touch handlers.

Anyone else running into a problem?

+4
source share
2 answers

As a work on this issue, I used JQuery Mobile touch events and listened to tapevents in the dropdown menu. Here is a simple implementation:

$(".dropdown-menu").on("tap", "li a", function(e, ui){ e.preventDefault(); if ($(this).attr("data-toggle") === "modal") { $($(this).attr('href')).modal("show"); } return false; }) 
+1
source

This seems to be a known issue that was resolved in bootstrap 2.1.2 - https://github.com/twitter/bootstrap/pull/5054 .

Edit: I tried to apply the changes to the ticket, but could not get it to work.

@CrimsonChin - you can tell in detail about your implementation. I tried your code, but with the help of loading JQM I get all kinds of weird behavior.

0
source

Source: https://habr.com/ru/post/1437352/


All Articles