Skip to content

bug: [4.6.0] ion-slide elements in wrong order when pushing a new slide to array #18633

Closed

Description

@nerdic-coder

Bug Report

Ionic version:
[x] 4.6.0

Current behavior:
When dynamically pushing new slides to ion-slides it adds the new slide one place before the last slide and leaves the previous last one on the last slide even thought the printed array is in correct order.

Expected behavior:
Add pushed slide item to the end of the slides.

Steps to reproduce:

  1. git clone https://github.com/nerdic-coder/ion-slider-sorting-bug.git
  2. cd ion-slider-sorting-bug
  3. npm install
  4. npm start
  5. See the slide is at zero.
  6. Slide forward and you see a 1.
  7. Slide forward again and you see a 3, but it should be slide number 2 as printed in the console log.
    Array is:
    0: {photoId: 0}
    1: {photoId: 1}
    2: {photoId: 2}
    3: {photoId: 3}

But elements are:
0
1
3
2
Related code:

A sample application via GitHub

https://github.com/nerdic-coder/ion-slider-sorting-bug/blob/master/src/components/app-home/app-home.tsx

Other information:

Ionic info:

PS E:\workspaces\ion-slider> ionic info

Ionic:

   Ionic CLI : 5.1.1 (C:\Users\johan\AppData\Roaming\npm\node_modules\ionic)

Utility:

   cordova-res : 0.3.0
   native-run  : not installed

System:

   NodeJS : v10.15.3 (C:\Program Files\nodejs\node.exe)
   npm    : 6.6.0
   OS     : Windows 10

Activity

  1. nerdic-coder commented on Jun 27, 2019

    @nerdic-coder
    Author

    Made a comparison branch with Ionic 4.5.0 and it works correct in that version:
    https://github.com/nerdic-coder/ion-slider-sorting-bug/tree/4.5.0

  2. brandyscarney commented on Jul 1, 2019

    @brandyscarney
    Member

    Thanks for the issue! I am going to close this as it has been fixed in Ionic, it will be in the 4.6.1 hotfix release. Please follow #18655 for updates on this. 🙂

  3. ionitron-bot commented on Jul 31, 2019

    @ionitron-bot

    Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

  4. locked and limited conversation to collaborators on Jul 31, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions