File tree Expand file tree Collapse file tree 2 files changed +14
-7
lines changed
elements/ReactSelect/MultiValue
providers/ComponentMap/buildComponentMap Expand file tree Collapse file tree 2 files changed +14
-7
lines changed Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ export const MultiValue: React.FC<MultiValueProps<Option>> = (props) => {
32
32
const classes = [
33
33
baseClass ,
34
34
className ,
35
- ! isDisabled && 'draggable' ,
35
+ ! isDisabled && isSortable && 'draggable' ,
36
36
isDragging && `${ baseClass } --is-dragging` ,
37
37
]
38
38
. filter ( Boolean )
@@ -45,20 +45,26 @@ export const MultiValue: React.FC<MultiValueProps<Option>> = (props) => {
45
45
{ ...props }
46
46
className = { classes }
47
47
innerProps = { {
48
+ ...( isSortable
49
+ ? {
50
+ ...attributes ,
51
+ ...listeners ,
52
+ }
53
+ : { } ) ,
48
54
...innerProps ,
49
- ...attributes ,
50
- ...listeners ,
51
55
onMouseDown : ( e ) => {
52
56
if ( ! disableMouseDown ) {
53
57
// we need to prevent the dropdown from opening when clicking on the drag handle, but not when a modal is open (i.e. the 'Relationship' field component)
54
58
e . stopPropagation ( )
55
59
}
56
60
} ,
57
61
ref : setNodeRef ,
58
- style : {
59
- transform,
60
- ...attributes ?. style ,
61
- } ,
62
+ style : isSortable
63
+ ? {
64
+ transform,
65
+ ...attributes ?. style ,
66
+ }
67
+ : { } ,
62
68
} }
63
69
/>
64
70
</ React . Fragment >
Original file line number Diff line number Diff line change @@ -524,6 +524,7 @@ export const mapFields = (args: {
524
524
className : field . admin ?. className ,
525
525
disabled : field . admin ?. disabled ,
526
526
hasMany : field . hasMany ,
527
+ isSortable : field . admin ?. isSortable ,
527
528
readOnly : field . admin ?. readOnly ,
528
529
relationTo : field . relationTo ,
529
530
required : field . required ,
You can’t perform that action at this time.
0 commit comments