Skip to content

dragEnabled does not update on AbsoluteGrid #51

Open
@muuhoffman

Description

@muuhoffman

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} />
    }
  }

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions