jellekralt / angular-drag-scroll

Lightweight drag to scroll directive for AngularJS
MIT License
35 stars 27 forks source link

ngClick or possibly other click events stops working after directive usage #10

Closed sqzbx closed 8 years ago

sqzbx commented 8 years ago

Firstly, great directive here. Specifically what I needed... :) I'm using it to enable drag-scroll with ion-contents that have overflow-scroll="true" Something like this <ion-content overflow-scroll="true" drag-scroll>long content here</ion-content> Inside that ion-content are basically other elements that have ng-click events on them, After clicking and dragging, successive clicks will only trigger the drag and scroll functionality and will render other clicks not working.

jellekralt commented 8 years ago

Hi, Do you have some more information for me? I cant seem to replicate this behaviour, the clicks work just fine. Could you maybe whip up an example?

sqzbx commented 8 years ago

Hi, For the simplest implementation I have in my app, I have the following html template:

<ion-view>
    <ion-content overflow-scroll="true" drag-scroll="enabled">
        <div class="card" ng-repeat="item in steps track by $index" ng-click="openModal('step', $index)">
            <div class="item">
                <h3>{{item.title}}</h3>
            </div>
        </div>
    </ion-content>
</ion-view>

I am currently using the directive to drag-and-scroll through this list. Each item opens a modal when clicked. The opening of modal only works once, after that I will still be able to drag-and-scroll the list but can't open modals.

I managed to solve this particular issue by removing the

e.preventDefault();
e.stopPropagation();

from the handleMouseDown function.

I tried to recreate the issue in a plunker, but same as you, I can't manage to replicate it. So its probably other things messing up the behavior of click events.

Thanks again for the great directive.

sqzbx commented 8 years ago

I'll close this issue. Since I can't replicate it outside the app I'm working on.

Thanks...