Skip to content

bug: in React, clicking to reorder an item in IonReorder gives TypeError: undefined is not an object #30592

@ptmkenny

Description

@ptmkenny

Prerequisites

Ionic Framework Version

v8.x

Current Behavior

After upgrading from 8.6.x to 8.7.x, IonReorder no longer works. Whenever I try to reorder an item, I get a console error: TypeError: undefined is not an object (evaluating 'children.length') In my own custom code, I noticed that to and from are returning -1 and undefined. This is happening both with the deprecated onIonItemReorder and the new onIonReorderEnd.

Expected Behavior

I expect to be able to reorder items like I could in 8.6.x.

Steps to Reproduce

  1. Launch the demo app and try to reorder an item. I am using the code from the docs.

Code Reproduction URL

https://github.com/ptmkenny/ionic-reorder-app

Ionic Info

Ionic:

Ionic CLI : 7.2.1 (/opt/homebrew/lib/node_modules/@ionic/cli)
Ionic Framework : @ionic/react 8.7.1

Capacitor:

Capacitor CLI : 7.4.2
@capacitor/android : not installed
@capacitor/core : 7.4.2
@capacitor/ios : not installed

Utility:

cordova-res : 0.15.4
native-run : 2.0.1

System:

NodeJS : v24.4.1 (/opt/homebrew/Cellar/node/24.4.1/bin/node)
npm : 11.4.2
OS : macOS Unknown

Additional Information

Reverting to 8.6.0 will restore reorder functionality.

It's not exactly related, but the deprecation message "message": "onIonItemReorderis deprecated. UseionReorderEndinstead. If you are accessingevent.detail.fromorevent.detail.toand relying on them being different you should now add checks as they are always emitted inionReorderEnd, even when they are the same.", is wrong because the prop is onIonReorderEnd not ionReorderEnd.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions