Skip to content

Commit

Permalink
Merge pull request #192 from i-akhmadullin/toggle_disabled_prop
Browse files Browse the repository at this point in the history
  • Loading branch information
andresin87 authored Jan 13, 2022
2 parents f469d75 + dccdd24 commit 881832d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/react-sortable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,11 @@ Please read the updated README.md at https://github.com/SortableJS/react-sortabl
const newOptions = this.makeOptions();
Sortable.create(this.ref.current, newOptions);
}
componentDidUpdate(prevProps: ReactSortableProps<T>): void {
if (prevProps.disabled !== this.props.disabled && this.sortable) {
this.sortable.option("disabled", this.props.disabled);
}
};

render(): JSX.Element {
const { tag, style, className, id } = this.props;
Expand Down

0 comments on commit 881832d

Please sign in to comment.