Skip to content

Commit

Permalink
Fix upper bound check for log column reordering
Browse files Browse the repository at this point in the history
  • Loading branch information
Alejandro Fernández Gómez committed Feb 20, 2020
1 parent a1c32a6 commit a4eb08d
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ export const useLogColumnsConfigurationFormState = ({

const moveLogColumn = useCallback(
(sourceIndex, destinationIndex) => {
if (destinationIndex >= 0 && sourceIndex < formState.logColumns.length - 1) {
if (destinationIndex >= 0 && sourceIndex <= formState.logColumns.length - 1) {
const newLogColumns = [...formState.logColumns];
newLogColumns.splice(destinationIndex, 0, newLogColumns.splice(sourceIndex, 1)[0]);
setFormStateChanges(changes => ({
Expand Down

0 comments on commit a4eb08d

Please sign in to comment.