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: Calling ion-reorder-group's complete with false doesn't reset ion-reorder's position #19128

Closed
ghost opened this issue Aug 19, 2019 · 5 comments · Fixed by #21396
Closed
Labels
package: core @ionic/core package type: bug a confirmed bug report

Comments

@ghost
Copy link

ghost commented Aug 19, 2019

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 bd96491 (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 (cordova-lib@9.0.1)
   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
@ionitron-bot ionitron-bot bot added the triage label Aug 19, 2019
@Yogatopia
Copy link

Yogatopia commented Aug 31, 2019

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 (cordova-lib@9.0.1)
   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

@ghost
Copy link
Author

ghost commented Sep 10, 2019

Looks like the documentation needs to be updated.

@vadim-shb
Copy link

vadim-shb commented Sep 16, 2019

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.

@ghost
Copy link
Author

ghost commented Sep 16, 2019

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.

@ionitron-bot
Copy link

ionitron-bot bot commented Jun 28, 2020

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.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Jun 28, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
package: core @ionic/core package type: bug a confirmed bug report
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants