Skip to content

Commit

Permalink
Fixed #2304 - Overlay panel hide when clicking on a label inside of it
Browse files Browse the repository at this point in the history
  • Loading branch information
mcandu committed Sep 21, 2021
1 parent 163fbf3 commit 1c4fc7b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/components/overlaypanel/OverlayPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,10 @@ export class OverlayPanel extends Component {
});
}

onContentClick() {
this.isPanelClicked = true;
}

toggle(event, target) {
if (this.state.visible) {
this.hide();
Expand Down Expand Up @@ -290,7 +294,7 @@ export class OverlayPanel extends Component {
<CSSTransition nodeRef={this.overlayRef} classNames="p-overlaypanel" in={this.state.visible} timeout={{ enter: 120, exit: 100 }} options={this.props.transitionOptions}
unmountOnExit onEnter={this.onEnter} onEntered={this.onEntered} onExit={this.onExit} onExited={this.onExited}>
<div ref={this.overlayRef} id={this.props.id} className={className} style={this.props.style} onClick={this.onPanelClick}>
<div className="p-overlaypanel-content">
<div className="p-overlaypanel-content" onClick={this.onContentClick} onMouseDown={this.onContentClick}>
{this.props.children}
</div>
{closeIcon}
Expand Down

0 comments on commit 1c4fc7b

Please sign in to comment.