Skip to content

Commit

Permalink
The page order doesn't work as expected in page setting page (appsmit…
Browse files Browse the repository at this point in the history
  • Loading branch information
rahulramesha authored May 11, 2022
1 parent 0571f9c commit 3923204
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion app/client/src/components/ads/DraggableList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ function DraggableList(props: any) {
itemHeight,
ItemRenderer,
items,
keyAccessor,
onUpdate,
updateDragging,
} = props;
Expand Down Expand Up @@ -236,7 +237,9 @@ function DraggableList(props: any) {
<animated.div
{...bind(i)}
data-rbd-draggable-id={items[i].id}
key={items[i].id}
//having a key of items[i].id will break in few places,
//eg, primary columns in propertyPane of Table widget
key={items[i][keyAccessor] || i}
style={{
zIndex,
width: "100%",
Expand Down
1 change: 1 addition & 0 deletions app/client/src/pages/Editor/PagesEditor/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ function PagesEditor() {
ItemRenderer={draggableListRenderItem}
itemHeight={70}
items={pages}
keyAccessor={"pageId"}
onUpdate={(newOrder: any, originalIndex: number, newIndex: number) => {
setPageOrderCallback(pages[originalIndex].pageId, newIndex);
}}
Expand Down

0 comments on commit 3923204

Please sign in to comment.