From cd5a27232a60fe2912d9dc31bba2c67012ce77da Mon Sep 17 00:00:00 2001 From: mertsincan Date: Mon, 12 Apr 2021 14:32:00 +0300 Subject: [PATCH] Refactor #1951 - For CascadeSelect --- src/components/cascadeselect/CascadeSelect.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/components/cascadeselect/CascadeSelect.js b/src/components/cascadeselect/CascadeSelect.js index 72a384dcc8..5474e976d2 100644 --- a/src/components/cascadeselect/CascadeSelect.js +++ b/src/components/cascadeselect/CascadeSelect.js @@ -257,9 +257,8 @@ export class CascadeSelect extends Component { this.bindOutsideClickListener(); this.bindScrollListener(); this.bindResizeListener(); - if (this.props.onShow) { - this.props.onShow(); - } + + this.props.onShow && this.props.onShow(); } onOverlayExit() { @@ -267,13 +266,12 @@ export class CascadeSelect extends Component { this.unbindScrollListener(); this.unbindResizeListener(); this.dirty = false; - if (this.props.onHide) { - this.props.onHide(); - } } onOverlayExited() { ZIndexUtils.clear(this.overlayRef.current); + + this.props.onHide && this.props.onHide(); } alignOverlay() {