react-sortablejs icon indicating copy to clipboard operation
react-sortablejs copied to clipboard

[bug] Why setList exec once when mounted ?

Open vaynevayne opened this issue 1 year ago • 1 comments

vaynevayne avatar Jun 02 '23 07:06 vaynevayne

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);
      }}

aiboost avatar Jun 27 '24 12:06 aiboost