Ionic-framework: bug: Calling ion-reorder-group's complete with false doesn't reset ion-reorder's position

Created on 19 Aug 2019  路  5Comments  路  Source: ionic-team/ionic-framework

Bug Report

Ionic version:


[x] 4.x

Current behavior:
Passing false to ion-reorder-group's complete doesn't reset the position of the dragged ion-reorder component.

Expected behavior:
Passing false to ion-reorder-group's complete should reset the position of the dragged ion-reorder component to its pre-dragged state.

Steps to reproduce:
StackBlitz: https://stackblitz.com/edit/ionic-v4-angular-tabs-nudxur

event.detail.complete(false); // should reset the reorder component's position

Other Information:
Looks like this broke in bd96491d03c98c9ac422baf9bdf52850c4cfd7b2 (see this line).

Could presumably be fixed by changing

if (toIndex !== fromIndex && (!listOrReorder || listOrReorder === true)) {

to

if (toIndex !== fromIndex && (listOrReorder === undefined || listOrReorder === true)) {

or similar.

Ionic info:

Ionic:

   Ionic CLI                     : 5.2.5 (/usr/local/lib/node_modules/ionic)
   Ionic Framework               : @ionic/angular 4.7.4
   @angular-devkit/build-angular : 0.801.3
   @angular-devkit/schematics    : 8.1.3
   @angular/cli                  : 8.1.3
   @ionic/angular-toolkit        : 2.0.0

Cordova:

   Cordova CLI       : 9.0.0 ([email protected])
   Cordova Platforms : none
   Cordova Plugins   : no whitelisted plugins (0 plugins total)

Utility:

   cordova-res : not installed
   native-run  : 0.2.8 

System:

   Android SDK Tools : 26.1.1 (/home/marksill/Android/Sdk)
   NodeJS            : v10.15.2 (/usr/bin/node)
   npm               : 6.10.3
   OS                : Linux 5.0
core bug

Most helpful comment

This worked for me:
event.detail.complete({ listOrReorder: false });

Ionic info:

Ionic:

   Ionic CLI                     : 5.2.1 (/usr/local/lib/node_modules/ionic)
   Ionic Framework               : @ionic/angular 4.4.2
   @angular-devkit/build-angular : 0.13.9
   @angular-devkit/schematics    : 7.3.9
   @angular/cli                  : 7.3.9
   @ionic/angular-toolkit        : 1.5.1

Cordova:

   Cordova CLI       : 9.0.0 ([email protected])
   Cordova Platforms : none
   Cordova Plugins   : no whitelisted plugins (0 plugins total)

Utility:

   cordova-res : not installed
   native-run  : not installed

System:

   Android SDK Tools : 26.1.1 (/Users/Library/Android/sdk/)
   ios-sim           : 7.0.0
   NodeJS            : v10.14.1 (/usr/local/bin/node)
   npm               : 6.4.1
   OS                : macOS Mojave
   Xcode             : Xcode 10.1 Build version 10B61

All 5 comments

This worked for me:
event.detail.complete({ listOrReorder: false });

Ionic info:

Ionic:

   Ionic CLI                     : 5.2.1 (/usr/local/lib/node_modules/ionic)
   Ionic Framework               : @ionic/angular 4.4.2
   @angular-devkit/build-angular : 0.13.9
   @angular-devkit/schematics    : 7.3.9
   @angular/cli                  : 7.3.9
   @ionic/angular-toolkit        : 1.5.1

Cordova:

   Cordova CLI       : 9.0.0 ([email protected])
   Cordova Platforms : none
   Cordova Plugins   : no whitelisted plugins (0 plugins total)

Utility:

   cordova-res : not installed
   native-run  : not installed

System:

   Android SDK Tools : 26.1.1 (/Users/Library/Android/sdk/)
   ios-sim           : 7.0.0
   NodeJS            : v10.14.1 (/usr/local/bin/node)
   npm               : 6.4.1
   OS                : macOS Mojave
   Xcode             : Xcode 10.1 Build version 10B61

Looks like the documentation needs to be updated.

Looks like the documentation needs to be updated.

I believe it's still a bug and your first fix suggestion is correct.
@Yogatopia provided nice workaround, but we can use any nonempty object to get the same effect.
event.detail.complete({ any: "thing" });
works for me as well, which doesn't seem a proper API.

Looks like the documentation needs to be updated.

I believe it's still a bug and your first fix suggestion is correct.
@Yogatopia provided nice workaround, but we can use any nonempty object to get the same effect.
event.detail.complete({ any: "thing" });
works for me as well, which doesn't seem a proper API.

Yeah, that definitely doesn't look like intended behavior.

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.

Was this page helpful?
0 / 5 - 0 ratings