Skip to content

Commit

Permalink
Refactor #2368
Browse files Browse the repository at this point in the history
  • Loading branch information
mertsincan committed Nov 1, 2021
1 parent 0c962e0 commit da3ed51
Showing 1 changed file with 19 additions and 16 deletions.
35 changes: 19 additions & 16 deletions src/components/datatable/BodyCell.js
Original file line number Diff line number Diff line change
Expand Up @@ -243,25 +243,28 @@ export class BodyCell extends Component {
onBeforeCellEditShow(params);
}

this.setState({
editing: true
}, () => {
if (onCellEditInit) {
onCellEditInit(params);
}
// If the data is sorted using sort icon, it has been added to wait for the sort operation when any cell is wanted to be opened.
setTimeout(() => {
this.setState({
editing: true
}, () => {
if (onCellEditInit) {
onCellEditInit(params);
}

if (cellEditValidatorEvent === 'click') {
this.bindDocumentEditListener();
if (cellEditValidatorEvent === 'click') {
this.bindDocumentEditListener();

this.overlayEventListener = (e) => {
if (!this.isOutsideClicked(e.target)) {
this.selfClick = true;
}
};
this.overlayEventListener = (e) => {
if (!this.isOutsideClicked(e.target)) {
this.selfClick = true;
}
};

OverlayService.on('overlay-click', this.overlayEventListener);
}
});
OverlayService.on('overlay-click', this.overlayEventListener);
}
});
}, 1);
}

if (this.props.allowCellSelection && this.props.onClick) {
Expand Down

0 comments on commit da3ed51

Please sign in to comment.