Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug when creating buttons inside the carousel and clicking on them #9

Open
pantonis opened this issue Sep 11, 2017 · 3 comments
Open

Comments

@pantonis
Copy link

 <div ng2-carouselamos [width]="1300" [items]="productTypes" [$item]="itemTemplate" [$prev]="prevTemplate" [$next]="nextTemplate"></div>

                <ng-template #prevTemplate>
                    <span class="">
                            <i class="fa fa-arrow-left" aria-hidden="true"></i>
                        </span>
                </ng-template>

                <ng-template #nextTemplate>
                    <span class="">
                        <i class="fa fa-arrow-right" aria-hidden="true"></i>
                    </span>
                </ng-template>

                <ng-template let-item let-i="index" #itemTemplate>
                    <div class="btn-group" data-toggle="buttons">
                        <label class="btn margin-right-5" [ngClass]="(item.Selected === true) ? 'btn-selected' : 'btn-not-selected'" (click)="productTypesClicked(item)">                        
                            <input type="checkbox" class="toggle" [value]="item.Name">{{item.Name}}
                        </label>
                    </div>
                </ng-template>

in TS

export class CarouselItem {
    Name: string;
    Selected: boolean;

    constructor(name: string, selected: boolean) {
        this.Name = name;
        this.Selected = selected;
    }
}

    public assetTypeClicked(item: CarouselItem): void {
        item.Selected = !item.Selected;
        alert(item.Name);
    }

Try to click the first 2-3 items on the left then press the next button then try to click on buttons next to next button. Instead of the assetTypeClicked event to be fired the carousel scrolls left

@ch-hristov
Copy link

+1, did you find a way to fix this?

@pantonis
Copy link
Author

no. dont have the time to check it :(

@GusAV
Copy link

GusAV commented Nov 14, 2017

This can be fixed by commenting the this.snap inside mouseUp function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants