Skip to content

[bug] options are not dynamic / reactive #211

Open
@gregg-cbs

Description

@gregg-cbs

Describe the bug
When adding sort, disabled and possibly other options to ReactSortable and assigning it a state property to toggle sort, it does not toggle when the state changes.

const [isSortingEnabled, setIsSortingEnabled] = useState(false);

<ReactSortable 
  sort={isSortingEnabled}
>

To Reproduce
Steps to reproduce the behavior:

  1. Add sort={isSortingEnabled} to ReactSortable
  2. Change isSortingEnabled from false to true
  3. Notice sort is not enabled

Expected behavior
Sort to be toggle when state changes

Information
This is required. Issues without this critical information will be closed.

Versions - Look in your package.json for this information:
react-sortable = ^1.13.0
react = ^16.13.1

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions