Skip to content

Ionic beta.16 reorder list throws error. Using Ionic 4 with VueJs #16433

Closed

Description

@stripathix

Bug Report

Ionic Info
Run ionic info from a terminal/cmd prompt and paste the output below.

Beta.16

Describe the Bug
Sometimes I get this error:

reorder node not found
ReorderGroup.canStart | @ | ej7i9is4.entry.js?db64:107
-- | -- | --
  | canStart | @ | ej7i9is4.entry.js?db64:82
  | pointerDown | @ | gesture.js?a52d:246
  | handleMouseDown | @ | gesture.js?a52d:69

And on doing drag/drop I get this

Uncaught TypeError: reorderGroup.complete is not a function
    at VueComponent.reorderedsss (RouteForm.js?e195:218)
    at invoker (vue.runtime.esm.js?2b0e:2023)
    at HTMLElement.fn._withTask.fn._withTask (vue.runtime.esm.js?2b0e:1822)
    at Object.Hn (ionic.core.js?1390:6)
    at Object.t.emit [as vn] (ionic.core.js?1390:6)
    at Object.emit (ionic.core.js?1390:6)
    at ReorderGroup.onEnd (ej7i9is4.entry.js?db64:201)
    at onEnd (ej7i9is4.entry.js?db64:85)
    at pointerUp (gesture.js?a52d:332)
    at HTMLDocument.handleMouseUp (gesture.js?a52d:88)

Steps to Reproduce
I have ion-reorder-group list in modal.

Related Code
In HTML

<ion-list>
      <ion-reorder-group @ionItemReorder="reorderedEvent" disabled="false">
      <ion-item>
        <ion-label>
          Item 1
        </ion-label>
        <ion-reorder slot="end"></ion-reorder>
      </ion-item>

      <ion-item>
        <ion-label>
          Item 2 (default ion-reorder slot="start")
        </ion-label>
        <ion-reorder slot="start"></ion-reorder>
      </ion-item>
    </ion-reorder-group>
  </ion-list>

In VueJs component I have method.

reorderedEvent(detail) {
            const reorderGroup = document.querySelector("ion-reorder-group");
            reorderGroup.complete();
        },

I have tried both .complete() with ion-reorder-group element selector and even (detail) parameter but for both I get

RouteForm.js?e195:218 Uncaught TypeError: reorderGroup.complete is not a function
    at VueComponent.reorderedsss (RouteForm.js?e195:218)
    at invoker (vue.runtime.esm.js?2b0e:2023)
    at HTMLElement.fn._withTask.fn._withTask (vue.runtime.esm.js?2b0e:1822)
    at Object.Hn (ionic.core.js?1390:6)
    at Object.t.emit [as vn] (ionic.core.js?1390:6)
    at Object.emit (ionic.core.js?1390:6)
    at ReorderGroup.onEnd (ej7i9is4.entry.js?db64:201)
    at onEnd (ej7i9is4.entry.js?db64:85)
    at pointerUp (gesture.js?a52d:332)
    at HTMLDocument.handleMouseUp (gesture.js?a52d:88)

Expected Behavior
A clear and concise description of what you expected to happen.

Additional Context
List any other information that is relevant to your issue. Stack traces, related issues, suggestions on how to fix, Stack Overflow links, forum links, screenshots, OS if applicable, etc.

Activity

  1. changed the title [-]Ionic beta.15 reorder list throws error. Using Ionic 4 with VueJs[/-] [+]Ionic beta.16 reorder list throws error. Using Ionic 4 with VueJs[/+] on Nov 23, 2018
  2. stripathix commented on Nov 23, 2018

    @stripathix
    Author

    Hi @manucorporat, Please could look into this if I am doing anything wrong or ionic have a bug related to reorder list?
    I am using reorder list in modal.

    screenshot 2018-11-23 at 4 27 03 pm

  3. manucorporat commented on Nov 28, 2018

    @manucorporat
    Contributor

    can you debug it further? what is detail? it might be the event itself

  4. added
    needs: reply
    on Nov 28, 2018
  5. high1 commented on Dec 6, 2018

    @high1

    This issue is not exclusive to Vue, same thing happens on @ionic/angular. Reorder node not found and list is frozen. Calling complete on ev.detail.complete() does not work. Same behaviour can be seen on the sample reorder page on beta documentation site.

  6. added and removed
    needs: reply
    on Dec 6, 2018
  7. added
    package: core
    type: bug
    and removed
    package: vue
    on Dec 6, 2018
  8. 3 remaining items

  9. anish714 commented on Dec 21, 2018

    @anish714

    @stripathix, you have to call ev.detail.complete(); inside your ionItemReorder event.

  10. daem0ndev commented on Dec 26, 2018

    @daem0ndev
    Contributor

    I am also seeing this issue with a slight caveat... after doing ev.detail.complete() in the ionItemReorder handler, it stopped the error on the first time, but if i close and reopen the page again then it throws the reorder node not found error as soon as I click one of the reorder handles.

    (this is on ionic/angular btw)

  11. david0178418 commented on Dec 28, 2018

    @david0178418

    Can confirm the same behavior in rc0 w/ angular described by @daem0ndev . I can resort lists the first time I navigate to a page, but if I navigate away and return, I get the following.

    image

    image

  12. david0178418 commented on Dec 28, 2018

    @david0178418

    Quick addendum. I was so focused on trying to figure out the bug, I just realized that it seems to be benign. The reorder works as well as the event handler.

  13. high1 commented on Jan 8, 2019

    @high1

    I could not reproduce this with rc0 - reorder is working.

  14. IsaacSomething commented on Jan 20, 2019

    @IsaacSomething

    Im getting this issue on "@ionic/angular": "^4.0.0-rc.2",

    i have pretty basic setup with the order items in a *ngFor

    <ion-list no-padding>
        <ion-reorder-group (ionItemReorder)="reorder($event)">
    
          <ion-item *ngFor="let item of items">
            <ion-label padding-start> {{item}} </ion-label>
            <ion-reorder></ion-reorder>
          </ion-item>
    
       </ion-reorder-group>
    </ion-list>
    
  15. high1 commented on Jan 20, 2019

    @high1

    You must call event.detail.complete() in reorder function. Reordering works, there still an issue with reorder node not found in console, but it does not break the functionality.

  16. added a commit that references this issue on Jan 21, 2019
    7b8d00e
  17. added a commit that references this issue on Jan 21, 2019
    59bd823
  18. IsaacSomething commented on Jan 21, 2019

    @IsaacSomething

    I dont think this issue should be closed. Yes as @high1 pointed out, it does break the reorder functionality but there is still a console error.

  19. manucorporat commented on Jan 21, 2019

    @manucorporat
    Contributor

    The underlining issue has been fixed in the PR above
    59bd823

  20. ionitron-bot commented on Feb 20, 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.

  21. locked and limited conversation to collaborators on Feb 20, 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

    package: coretype: bug

    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