Skip to content

Slider with 2 slides reporting false 3rd slide #10740

@RickeyWard

Description

@RickeyWard

Ionic version: (check one with "x")
[ ] 1.x
[X] 2.x

I'm submitting a ... (check one with "x")
[ X] bug report
[ ] feature request
[ ] support request => Please do not submit support requests here, use one of these channels: https://forum.ionicframework.com/ or http://ionicworldwide.herokuapp.com/

Current behavior:

Using slides, when sliding to the last slide (where there is only 2 slides) attempting to slide right again, causes the didchange event to fire again, and with the activeIndex returning 1 greater than the actual max index.

Expected behavior:

Should not fire the event, and if it does fire getActiveIndex() should return the max index, not actual index +1

Steps to reproduce:

http://plnkr.co/edit/vRgvUwG4H0TPirnJzZk3?p=preview

As you can see from this plunker, turn on the console, and swipe to move the slider 2 times. It should only move 1 time (which visually it does) but you'll see the change event gets fired again. And when it does the activeIndex reports a slide that doesn't exist.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions