SortableJS / react-sortablejs

React bindings for SortableJS
http://sortablejs.github.io/react-sortablejs/
MIT License
1.98k stars 206 forks source link

[bug] Why setList exec once when mounted ? #277

Open vaynevayne opened 1 year ago

aiboost commented 6 days ago

I agree. It's sad that we need to use such inelegant workaround like:

private isSettingListOnMount = true;

....

      setList={(newList) => {
          if (this.isSettingListOnMount) {
              this.isSettingListOnMount = false;
              return;
          }
          this.props.onChange(newList);
      }}