Skip to content

Commit

Permalink
Fix array widget sort (#5804)
Browse files Browse the repository at this point in the history
  • Loading branch information
giuliaghisini authored Feb 27, 2024
1 parent 457a0bc commit 0855d50
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions news/5804.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixed ArrayWidget sorting items. @giuliaghisini
5 changes: 3 additions & 2 deletions src/components/manage/Widgets/ArrayWidget.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -299,14 +299,15 @@ class ArrayWidget extends Component {
!this.props.creatable
? SortableContainer(Select)
: SortableContainer(CreatableSelect);

return (
<FormFieldWrapper {...this.props}>
<SortableSelect
useDragHandle
// react-sortable-hoc props:
axis="xy"
onSortEnd={this.onSortEnd}
onSortEnd={(sortProp) => {
this.onSortEnd(selectedOption, sortProp);
}}
menuShouldScrollIntoView={false}
distance={4}
// small fix for https://github.com/clauderic/react-sortable-hoc/pull/352:
Expand Down

0 comments on commit 0855d50

Please sign in to comment.