Skip to content

[4.0.0-beta.13] ion-reorder-group/ion-reorder: buggy list after item is dropped #16068

Closed

Description

@gem85247

Bug Report

Ionic Info

Ionic:

   ionic (Ionic CLI)             : 4.2.1 (/usr/local/lib/node_modules/ionic)
   Ionic Framework               : @ionic/angular 4.0.0-beta.13
   @angular-devkit/build-angular : 0.10.2
   @angular-devkit/schematics    : 7.0.2
   @angular/cli                  : 7.0.2
   @ionic/angular-toolkit        : 1.0.0

Cordova:

   cordova (Cordova CLI) : 8.0.0
   Cordova Platforms     : ios 4.5.5
   Cordova Plugins       : cordova-plugin-ionic 5.2.5, cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 2.2.0, (and 11 other plugins)

System:

   ios-deploy : 2.0.0
   ios-sim    : 7.0.0
   NodeJS     : v10.12.0 (/usr/local/Cellar/node/9.11.1/bin/node)
   npm        : 6.4.1
   OS         : macOS
   Xcode      : Xcode 10.0 Build version 10A255


Describe the Bug
When I drag an element and drop it (within the ) the view gets messed up/buggy.

Before interaction:

image

After (drag &) dropping an item:

image

Steps to Reproduce
Steps to reproduce the behavior:

  1. make basic re-ordable list
  2. drag & drop an item
  3. See messed up list view
NO ERRORS ARE THROWN DURING THESE ACTIONS

Related Code
html code:

<ion-content>
  <ion-list>
        <ion-list-header>
            <ion-label>INCLUDE</ion-label>
        </ion-list-header>
        <ion-reorder-group (ionItemReorder)="reorder($event)" [disabled]="false">
            <ion-item *ngFor="let accessory of accessories">
                <ion-label>{{accessory}}</ion-label>
                <ion-reorder></ion-reorder>
            </ion-item>
        </ion-reorder-group>
   </ion-list>
</ion-content>

typescript code:

 accessories = ['test', 'test1', 'test2'];

reorder(event) {
        const itemToMove = this.accessories.splice(event.detail.from, 1)[0];
        this.accessories.splice(event.detail.to, 0, itemToMove);
    }

Expected Behavior
no messed up view

Activity

  1. chopstickqy commented on Oct 25, 2018

    @chopstickqy

    i face the same issue with use broswer to test the feature.
    image
    after i drag & drop
    image
    and the items can't dragged anymore

  2. MarkChrisLevy commented on Oct 26, 2018

    @MarkChrisLevy
    Contributor

    @gentleen @GillesMontyne You have to complete reordering by calling complete on ReorderGroup instance. Read the docs:
    https://github.com/ionic-team/ionic/tree/master/core/src/components/reorder-group

    Once the data structure has been updated to reflect the reorder change, the complete() method must be called. This method finishes the reorder operation and resets all the CSS transforms applied by the ion-reorder-group component.

  3. gem85247 commented on Oct 27, 2018

    @gem85247
    Author

    thx, this solved my issue!

  4. TrayserCassa commented on Oct 29, 2018

    @TrayserCassa

    @mmlleevvyy

    @gentleen @GillesMontyne You have to complete reordering by calling complete on ReorderGroup instance. Read the docs:
    https://github.com/ionic-team/ionic/tree/master/core/src/components/reorder-group

    Once the data structure has been updated to reflect the reorder change, the complete() method must be called. This method finishes the reorder operation and resets all the CSS transforms applied by the ion-reorder-group component.

    Should this not moved to the ionic Doku beta page?

  5. MarkChrisLevy commented on Oct 29, 2018

    @MarkChrisLevy
    Contributor

    @TrayserCassa It should and I guess that it will be... but can't tell why it is not present in docs website. @brandyscarney ?

  6. brandyscarney commented on Oct 29, 2018

    @brandyscarney
    Member

    We will have the API documentation updated soon. It hasn't been deployed since beta.11 so it is out of sync with the current API reference. I created an issue for the description being cut off: ionic-team/ionic-docs#160

    In the future if you see any issues with documentation (outdated, incomplete, etc.) please create an issue on the ionic-docs repository. Thank you!

  7. yuricamara commented on Nov 9, 2018

    @yuricamara

    Hi @brandyscarney!

    The example in the doc is freezing when the element is dropped. The page says 4.0.0-beta.15.

  8. emgould commented on Nov 19, 2018

    @emgould

    Same here. I get an error: reorder node not found and it freezes. This is on a page that is routed to from a tab. I did notice that the page also fails to fire an ionViewDidLoad event as well which is another issue already reported but it is possible that is related here.

    beta16 does not show the error message but the item still freezes upon release of the drag.

  9. emgould commented on Nov 19, 2018

    @emgould

    Resolved. Add implements OnInit to my page component. Then added the reorder event listener. All good now.

  10. TrayserCassa commented on Nov 29, 2018

    @TrayserCassa

    @yuricamara

    Zitat:
    In the future if you see any issues with documentation (outdated, incomplete, etc.) please create an issue on the ionic-docs repository. Thank you!

    This is the wrong issue tracker for doc errors ...

  11. yuricamara commented on Nov 29, 2018

    @yuricamara

    @TrayserCassa , thank you for your advice but this was NOT about doc. I was talking about an official example by chance in the doc.

  12. brandyscarney commented on Nov 29, 2018

    @brandyscarney
    Member

    Thanks @yuricamara! I added a comment for that in the issue that I created on the docs site since it's an issue with the demo code and not the ionic source: ionic-team/ionic-docs#160

    We'll look into getting that fixed!

  13. yuricamara commented on Nov 29, 2018

    @yuricamara
  14. ionitron-bot commented on Dec 29, 2018

    @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.

  15. locked and limited conversation to collaborators on Dec 29, 2018
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

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions