clauderic / clauderic/react-sortable-hoc

Item being dragged is not moving when lockToContainerEdges is true

Open
#655 5 comments 2 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
10.9k
Forks
959
PR merge metrics
No merged PRs in 30d

Description

Item being dragged is not moving. I'm using the basic example to do this with the lockToContainerEdges prop. Sample code below:

`const SortableItem = sortableElement(({value}) =>

  • {value}
  • );

    const SortableContainer = sortableContainer(({children}) => {
    return

      {children}
    ;
    });

    class App extends Component {
    state = {
    items: ['Item 1', 'Item 2', 'Item 3', 'Item 4', 'Item 5', 'Item 6'],
    };

    onSortEnd = ({oldIndex, newIndex}) => {
    this.setState(({items}) => ({
    items: arrayMove(items, oldIndex, newIndex),
    }));
    };

    render() {
    const {items} = this.state;

    return (

    {items.map((value, index) => (

    ))}

    );
    }
    }`

    Contributor guide

    No contributing guide indexed for this repository

    Assessment

    This issue has not been assessed yet.

    Get new issues in your inbox

    A short digest of beginner-friendly GitHub issues.