diff --git a/src/components/splitbutton/SplitButton.js b/src/components/splitbutton/SplitButton.js index 4b68e2531e..fabc547df3 100644 --- a/src/components/splitbutton/SplitButton.js +++ b/src/components/splitbutton/SplitButton.js @@ -111,13 +111,8 @@ export class SplitButton extends Component { alignPanel() { const container = this.defaultButton.parentElement; - if (this.props.appendTo) { - this.overlayRef.current.style.minWidth = DomHandler.getWidth(container) + 'px'; - DomHandler.absolutePosition(this.overlayRef.current, container); - } - else { - DomHandler.relativePosition(this.overlayRef.current, container); - } + this.overlayRef.current.style.minWidth = DomHandler.getOuterWidth(container) + 'px'; + DomHandler.absolutePosition(this.overlayRef.current, container); } bindDocumentClickListener() { diff --git a/src/components/splitbutton/SplitButtonPanel.js b/src/components/splitbutton/SplitButtonPanel.js index 1f7543c003..d226e9d66a 100644 --- a/src/components/splitbutton/SplitButtonPanel.js +++ b/src/components/splitbutton/SplitButtonPanel.js @@ -40,12 +40,7 @@ class SplitButtonPanelComponent extends Component { render() { let element = this.renderElement(); - if (this.props.appendTo) { - return ReactDOM.createPortal(element, this.props.appendTo); - } - else { - return element; - } + return ReactDOM.createPortal(element, this.props.appendTo || document.body); } }