yuche / vue-strap

Bootstrap components built with Vue.js
http://yuche.github.io/vue-strap/
MIT License
4.71k stars 932 forks source link

chrome/touchstart bug on dropdown mobile #439

Open surgiie opened 7 years ago

surgiie commented 7 years ago

Im using the navbar/dropdown component in one of my projects and it works perfect on desktop but when testing on chrome mobile or in chromes mobile emulator i cant click on my links. It wont navigate to any of my links.

Vue-strap version: 1.1.32 Vue: 1.0.28

Works just fine in mobile edge and mobile firefox. I noticed that if i remove the touchstart event listener on navbar it will work. Chrome bug or Vue-strap?

touchstart

surgiie commented 7 years ago

Removing this in vue-strap.js fixes the issue.

(0, _NodeList2.default)(this.$el).on('click touchstart', 'li:not(.dropdown)>a', function (e){
    setTimeout(function () {
    _this.collapsed = true;
    }, 200);
}).onBlur(function (e) {
    if (!_this.$el.contains(e.target)) {
        _this.collapsed = true;
     }
});