From 0a634833b8205a5eb7d48d632ee3202595de5603 Mon Sep 17 00:00:00 2001 From: mertsincan Date: Tue, 16 Mar 2021 13:57:16 +0300 Subject: [PATCH] Refactor #1878 - For SplitButton --- src/components/splitbutton/SplitButton.js | 7 ++++++- src/components/splitbutton/SplitButtonPanel.js | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/components/splitbutton/SplitButton.js b/src/components/splitbutton/SplitButton.js index fabc547df3..9931d1f7e1 100644 --- a/src/components/splitbutton/SplitButton.js +++ b/src/components/splitbutton/SplitButton.js @@ -60,6 +60,7 @@ export class SplitButton extends Component { this.onOverlayEnter = this.onOverlayEnter.bind(this); this.onOverlayEntered = this.onOverlayEntered.bind(this); this.onOverlayExit = this.onOverlayExit.bind(this); + this.onOverlayExited = this.onOverlayExited.bind(this); this.onPanelClick = this.onPanelClick.bind(this); this.id = this.props.id || UniqueComponentId(); @@ -109,6 +110,10 @@ export class SplitButton extends Component { this.unbindResizeListener(); } + onOverlayExited() { + DomHandler.revertZIndex(); + } + alignPanel() { const container = this.defaultButton.parentElement; this.overlayRef.current.style.minWidth = DomHandler.getOuterWidth(container) + 'px'; @@ -235,7 +240,7 @@ export class SplitButton extends Component { aria-expanded={this.state.overlayVisible} aria-haspopup aria-owns={this.id + '_overlay'} /> + in={this.state.overlayVisible} onEnter={this.onOverlayEnter} onEntered={this.onOverlayEntered} onExit={this.onOverlayExit} onExited={this.onOverlayExited}> {items} diff --git a/src/components/splitbutton/SplitButtonPanel.js b/src/components/splitbutton/SplitButtonPanel.js index d226e9d66a..022e60fff0 100644 --- a/src/components/splitbutton/SplitButtonPanel.js +++ b/src/components/splitbutton/SplitButtonPanel.js @@ -27,7 +27,7 @@ class SplitButtonPanelComponent extends Component { return ( + unmountOnExit onEnter={this.props.onEnter} onEntered={this.props.onEntered} onExit={this.props.onExit} onExited={this.props.onExited}>
    {this.props.children}