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

Fix CMS: Rearrangeable array elements #230 #329

Merged
merged 1 commit into from
Mar 15, 2025

Conversation

xy9iao
Copy link
Contributor

@xy9iao xy9iao commented Mar 4, 2025

Fix #230: Enable reordering in EditorArrayNode

Changes Made:

  • Added Move Up / Down buttons to allow users to swap items
  • Make sure UI update after swapping elements: Forced React to re-render components using key to ensure changes are reflected

Reason for forcing re-rendering:

  • After transforming the previous data to the new location, only the image data re-renders. The Name and Room parts remian the same on UI
  • Had to force re-rendering using:
    key={`${index}-${version}`}

@xy9iao xy9iao changed the title Fix #230: Added Move Up / Move Down buttons in EditorArrayNode for re… Fix CMS: Rearrangeable array elements #230 Mar 4, 2025
@xy9iao xy9iao requested a review from some-molasses March 5, 2025 06:02
@xy9iao xy9iao merged commit 227896a into main Mar 15, 2025
3 checks passed
@xy9iao xy9iao deleted the rearrangeable-array-elements branch March 15, 2025 23:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CMS: Rearrangeable array elements
2 participants