react-absolute-grid
react-absolute-grid copied to clipboard
dragEnabled does not update on AbsoluteGrid
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} />
}
}
Unfortunately it's only updating on mount/unmount. This is definitely a bug.