List component, drag handler: added check for source and destination id being the same

This commit is contained in:
gianantoniopini
2021-02-09 12:31:54 +01:00
parent 8ce73a38ea
commit bd1bd2fc97

View File

@ -44,6 +44,10 @@ const List = ({
return; return;
} }
if (source.index === destination.index) {
return;
}
const itemsReordered = reorder(items, source.index, destination.index); const itemsReordered = reorder(items, source.index, destination.index);
dispatch({ dispatch({
type: 'on_input', type: 'on_input',