Skip to content

bug: When using IonReorder and trying to save the order in state, the list snaps to a different order #28496

@filifunk

Description

@filifunk

Prerequisites

Ionic Framework Version

v7.x

Current Behavior

I've got an array of arrays stored in state called items, I want to reorder the array of arrays and save it within state with the new order. Instead I seem to get a random order.

Expected Behavior

I expect it to work so that when I reorder the array of arrays, the order stays in that new order and I'm able to save it in state. The order stays how I expect it to only if I get rid of the line where I try to use setItems to save the new order.

Steps to Reproduce

https://stackblitz.com/edit/ionic-react-starter-telztw?file=pages%2FHome.js

Try and reorder the list here. I can't get it to stick.

Code Reproduction URL

https://stackblitz.com/edit/ionic-react-starter-telztw?file=pages%2FHome.js

Ionic Info

Ionic:

Ionic CLI : 7.1.1 (/usr/local/lib/node_modules/@ionic/cli)
Ionic Framework : @ionic/react 7.2.3

Capacitor:

Capacitor CLI : 5.2.3
@capacitor/android : 5.2.3
@capacitor/core : 5.2.3
@capacitor/ios : 5.3.0

Utility:

cordova-res : 0.15.4
native-run (update available: 2.0.0) : 1.7.2

System:

NodeJS : v16.20.0 (/usr/local/bin/node)
npm : 8.19.4
OS : Linux 5.14

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions