Skip to content

Commit

Permalink
fix: reorderable list no longer toggles on backout
Browse files Browse the repository at this point in the history
  • Loading branch information
Tormak9970 committed Apr 4, 2023
1 parent b1591f8 commit 7e1182a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/custom-components/ReorderableList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,9 @@ export function ReorderableList<T>(props: ReorderableListProps<T>) {

function saveOnBackout(e: Event) {
const event = e as CustomEvent;
if (event.detail.button == GamepadButton.CANCEL) {
toggleReorderEnabled();
if (event.detail.button == GamepadButton.CANCEL && reorderEnabled) {
setReorderEnabled(!reorderEnabled);
props.onSave(entryList);
}
}

Expand Down

0 comments on commit 7e1182a

Please sign in to comment.