From 000096baea361a3650b953131e8c2587829f6a8d Mon Sep 17 00:00:00 2001 From: mertsincan Date: Mon, 1 Mar 2021 13:29:51 +0300 Subject: [PATCH] Refactor #1832 - For CascadeSelect --- src/components/cascadeselect/CascadeSelect.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/components/cascadeselect/CascadeSelect.js b/src/components/cascadeselect/CascadeSelect.js index 397ddc458b..23a78a1d76 100644 --- a/src/components/cascadeselect/CascadeSelect.js +++ b/src/components/cascadeselect/CascadeSelect.js @@ -8,6 +8,7 @@ import UniqueComponentId from '../utils/UniqueComponentId'; import { CSSTransition } from "react-transition-group"; import ConnectedOverlayScrollHandler from '../utils/ConnectedOverlayScrollHandler'; import { CascadeSelectSub } from "./CascadeSelectSub"; +import { PrimeEventBus } from '../utils/PrimeEventBus'; export class CascadeSelect extends Component { @@ -85,6 +86,7 @@ export class CascadeSelect extends Component { this.onOverlayExit = this.onOverlayExit.bind(this); this.onOptionSelect = this.onOptionSelect.bind(this); this.onOptionGroupSelect = this.onOptionGroupSelect.bind(this); + this.onPanelClick = this.onPanelClick.bind(this); } onOptionSelect(event) { @@ -211,6 +213,13 @@ export class CascadeSelect extends Component { } } + onPanelClick(event) { + PrimeEventBus.emit('overlay-click', { + originalEvent: event, + target: this.container + }); + } + show() { if (this.props.onBeforeShow) { this.props.onBeforeShow(); @@ -371,7 +380,7 @@ export class CascadeSelect extends Component { const overlay = ( -
+