How to remove focus on a cell in a React-Bootstrap-Table?

993 views Asked by At

The problem I'm having is that if a user clicks to edit a cell but then does something on another view that re-renders the BootstrapTable, the cell is still focused and retaining the old value until the user clicks somewhere else on the table.

I tried the following:

onBootstrapTableRef(instance) {
    this.bootstrapTableRef = instance;
}

componentDidUpdate() {
    this.bootstrapTableRef.reset(); //feel like either of these lines should do the job
    this.bootstrapTableRef.cleanSelected();
}


public render() {
    const cellEdit = {
        mode: "click",
        blurToSave: true
    }

    return (
                <BootstrapTable data={this.props.settings} keyField="settingStage"
                    bordered={false} striped cellEdit={cellEdit} ref={this.onBootstrapTableRef}>
                    ...
                </BootstrapTable>
            </div>
        </div>
    );
}
0

There are 0 answers