react-absolute-grid icon indicating copy to clipboard operation
react-absolute-grid copied to clipboard

dragEnabled does not update on AbsoluteGrid

Open muuhoffman opened this issue 6 years ago • 1 comments

I don't want my grid to be draggable at certain times, so I have some state that I update to tell the grid whether it is draggable or not. However, ever though the grid rerenders when the updating the state from isDragEnabled = true -> isDragEnabled = false, the grid still remains draggable. Is this a bug?

render() {
    const { classes } = this.props;

    if (this.state.items !== null) {
      return <div className={classes.root}>
        <h2>{this.state.title}</h2>
        <Votes />
        {/* dragEnabled and TextField do not play well, so don't allow dragging when creating a post */}
        <AbsoluteGrid 
          items={this.state.items} 
          dragEnabled={this.state.isDragEnabled}
          itemWidth={220}
          itemHeight={250}/>
      </div>
    } else {
      return <CircularProgress size={50} />
    }
  }

muuhoffman avatar Oct 15 '18 02:10 muuhoffman

Unfortunately it's only updating on mount/unmount. This is definitely a bug.

jrowny avatar Jan 11 '19 16:01 jrowny