Skip to content

Can`t slide ion-item-option after reorder ion-item #17890

Closed

Description

@alperbalkaya

Bug Report

Ionic version:

[x] 4.x

Current behavior:

If an <ion-item-sliding> is dragged down in <ion-list>, it is possible to slide <ion-item-options>. But if the item is dragged up in the list, sliding is no longer possible.

2019-03-26_22-59-03

Expected behavior:

Sliding should still be possible if the item is dragged up in the list

Steps to reproduce:
See gif above

Related code:

<ion-list>
  <ion-reorder-group (ionItemReorder)="reorderConfigurationsList($event)" disabled="false">
    <ion-item-sliding *ngFor="let configuration of _configurationsList">
      <ion-item lines="full" color="white">
        <ion-label>
          <h2>{{configuration.name}}</h2>
          <ion-note>Created: {{ configuration.created | date: 'MM/dd/yy HH:mm' }}</ion-note>
        </ion-label>
        <ion-reorder slot="end"></ion-reorder>
      </ion-item>
      <ion-item-options side="start">
        <ion-item-option>Favorite</ion-item-option>
        <ion-item-option color="danger">Share</ion-item-option>
      </ion-item-options>
      <ion-item-options side="end">
        <ion-item-option>Unread</ion-item-option>
      </ion-item-options>
    </ion-item-sliding>
  </ion-reorder-group>
</ion-list>
reorderConfigurationsList(ev) {
    const itemToMove = this._configurationsList.splice(ev.detail.from, 1 ) [0];
    this._configurationsList.splice(ev.detail.to, 0, itemToMove );
    ev.detail.complete();
  }

Other information:

Ionic info:

Ionic:

   ionic (Ionic CLI)             : 4.12.0 (/usr/local/lib/node_modules/ionic)
   Ionic Framework               : @ionic/angular 4.1.2
   @angular-devkit/build-angular : 0.13.6
   @angular-devkit/schematics    : 7.2.4
   @angular/cli                  : 7.3.6
   @ionic/angular-toolkit        : 1.4.1

Cordova:

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

System:

   ios-sim : 8.0.0
   NodeJS  : v10.15.3 (/usr/local/bin/node)
   npm     : 6.9.0
   OS      : macOS Mojave
   Xcode   : Xcode 10.2 Build version 10E125

Activity

  1. added
    needs: reply
    on Mar 27, 2019
  2. removed
    needs: reply
    on Mar 27, 2019
  3. liamdebeasi commented on Mar 27, 2019

    @liamdebeasi
    Contributor

    Hi there,

    Thanks for the issue. Can you provide a repository with the code required to reproduce this issue? I am unable to reproduce it with the code snippet you provided.

    Thanks!

  4. added
    needs: reply
    on Mar 27, 2019
  5. alperbalkaya commented on Mar 27, 2019

    @alperbalkaya
    Author

    Hi there,

    Thanks for the issue. Can you provide a repository with the code required to reproduce this issue? I am unable to reproduce it with the code snippet you provided.

    Thanks!

    Of course. https://github.com/alperbalkaya/ionicReorderBug

  6. added and removed
    needs: reply
    on Mar 27, 2019
  7. added
    package: core
    type: bug
    on Mar 29, 2019
  8. liamdebeasi commented on Mar 29, 2019

    @liamdebeasi
    Contributor

    Thanks for the follow up.

    I have been investigating this issue and have a couple observations:

    1. When sliding the item up, componentDidUnload is being called on the ion-item-sliding that was moved. This is causing any gesture listeners on the element to be destroyed (including the listener that lets you reveal the sliding options).
    2. After componentDidUnload is called, there are still 3 items in the DOM (there were 3 to begin with). One would assume that the re-ordered item was destroyed and then re-created, but componentDidLoad was never fired. So I'm not sure if that means a) the component was firing componentDidUnload when it should not have been or b) the component was being re-created but not firing componentDidLoad when it should have been. (it also could be another case I'm not even thinking of 🙂)

    I'm going to continue to dig into this, but just wanted to keep you in the loop.

    Thanks!

  9. self-assigned this
    on Mar 29, 2019
  10. liamdebeasi commented on Apr 1, 2019

    @liamdebeasi
    Contributor

    Hi everyone,

    There are some changes to Stencil actively being worked on that we think may resolve this issue. I am going to do some testing with it later this week and will post here when I have an update.

    Thanks!

  11. 4 remaining items

  12. digaus commented on Apr 30, 2019

    @digaus

    Issue also appears when using reorder group inside another reorder group.

  13. changan712 commented on Apr 30, 2019

    @changan712

    c

  14. pauljohnberry commented on Jun 3, 2019

    @pauljohnberry

    Just for information, I have a similar issue. In my case I have an ion-range slider in the ion-item being reordered, When I reorder and change the underlying array (ie: ev.detail.complete(this.myArray);), the slider freezes. nb: this behavior does not manifest itself when just calling ev.detail.complete().

  15. added this to the Stencil One milestone on Jun 10, 2019
  16. andreas-aeschlimann commented on Jun 12, 2019

    @andreas-aeschlimann

    I have the same issue.

    Yes fix would be awesome. Current workaround is changing the list reference -JSON.parse(JSON.stringify(list)) - which forces a rerender

    I can confirm that this is a valid workaround. However, the whole list "blinks" for a short moment because for some reason, redrawing in Ionic is not as smooth as with Angular.

  17. brandyscarney commented on Jul 23, 2019

    @brandyscarney
    Member

    Thanks for the issue! I was able to test out the latest Ionic with the update to Stencil One and confirmed it is still an issue in 4.6.2 and latest.

  18. BDominik commented on Jul 26, 2019

    @BDominik
  19. added a commit that references this issue on Aug 27, 2019
    48a2763
  20. added a commit that references this issue on Aug 27, 2019
    7eb1089
  21. added a commit that references this issue on Aug 27, 2019
    69ee964
  22. Wilsonoonn commented on Sep 3, 2019

    @Wilsonoonn

    At present, in 4.12.0, there is still this problem, there is no final solution?

    @liamdebeasi

  23. liamdebeasi commented on Sep 3, 2019

    @liamdebeasi
    Contributor

    @Wilsonoonn This issue was fixed and will be available in the next stable release of Ionic. For any new bug, I recommend creating a new issue.

  24. ionitron-bot commented on Oct 3, 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.

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

Metadata

Metadata

Assignees

Labels

package: coretype: bug

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions