From fe1314958baf735081112467f37c82ad3e624f91 Mon Sep 17 00:00:00 2001 From: mertsincan Date: Fri, 15 Mar 2019 15:05:52 +0300 Subject: [PATCH] Fixed #814 - Overlays wrong position on initial/first render --- src/components/autocomplete/AutoComplete.js | 2 +- src/components/colorpicker/ColorPicker.js | 2 +- src/components/dropdown/Dropdown.js | 4 ++-- src/components/multiselect/MultiSelect.js | 2 +- src/components/splitbutton/SplitButton.js | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/components/autocomplete/AutoComplete.js b/src/components/autocomplete/AutoComplete.js index 94876ac307..0d970c0fd8 100644 --- a/src/components/autocomplete/AutoComplete.js +++ b/src/components/autocomplete/AutoComplete.js @@ -261,8 +261,8 @@ export class AutoComplete extends Component { let target = this.props.multiple ? this.multiContainer : this.inputEl; if (this.props.appendTo) { - DomHandler.absolutePosition(this.panel.element, target); this.panel.element.style.minWidth = DomHandler.getWidth(target) + 'px'; + DomHandler.absolutePosition(this.panel.element, target); } else { DomHandler.relativePosition(this.panel.element, target); diff --git a/src/components/colorpicker/ColorPicker.js b/src/components/colorpicker/ColorPicker.js index b710745731..2a5e8a794f 100644 --- a/src/components/colorpicker/ColorPicker.js +++ b/src/components/colorpicker/ColorPicker.js @@ -505,8 +505,8 @@ export class ColorPicker extends Component { alignPanel() { if (this.props.appendTo) { - DomHandler.absolutePosition(this.panel.element, this.container); this.panel.element.style.minWidth = DomHandler.getWidth(this.container) + 'px'; + DomHandler.absolutePosition(this.panel.element, this.container); } else { DomHandler.relativePosition(this.panel.element, this.container); diff --git a/src/components/dropdown/Dropdown.js b/src/components/dropdown/Dropdown.js index 2eb07fcaf3..9aac794ee7 100644 --- a/src/components/dropdown/Dropdown.js +++ b/src/components/dropdown/Dropdown.js @@ -423,7 +423,7 @@ export class Dropdown extends Component { return (index !== -1) ? this.props.options[index] : null; } - show() { + show() { this.panel.element.style.zIndex = String(DomHandler.generateZIndex()); this.panel.element.style.display = 'block'; @@ -453,8 +453,8 @@ export class Dropdown extends Component { alignPanel() { if(this.props.appendTo) { - DomHandler.absolutePosition(this.panel.element, this.container); this.panel.element.style.minWidth = DomHandler.getWidth(this.container) + 'px'; + DomHandler.absolutePosition(this.panel.element, this.container); } else { DomHandler.relativePosition(this.panel.element, this.container); diff --git a/src/components/multiselect/MultiSelect.js b/src/components/multiselect/MultiSelect.js index 692e38a2a8..b49123a3d7 100644 --- a/src/components/multiselect/MultiSelect.js +++ b/src/components/multiselect/MultiSelect.js @@ -233,8 +233,8 @@ export class MultiSelect extends Component { alignPanel() { if (this.props.appendTo) { - DomHandler.absolutePosition(this.panel.element, this.container); this.panel.element.style.minWidth = DomHandler.getWidth(this.container) + 'px'; + DomHandler.absolutePosition(this.panel.element, this.container); } else { DomHandler.relativePosition(this.panel.element, this.container); diff --git a/src/components/splitbutton/SplitButton.js b/src/components/splitbutton/SplitButton.js index 21f1e7b8e8..7dee80113e 100644 --- a/src/components/splitbutton/SplitButton.js +++ b/src/components/splitbutton/SplitButton.js @@ -92,8 +92,8 @@ export class SplitButton extends Component { alignPanel() { if (this.props.appendTo) { - DomHandler.absolutePosition(this.panel.element, this.container); this.panel.element.style.minWidth = DomHandler.getWidth(this.container) + 'px'; + DomHandler.absolutePosition(this.panel.element, this.container); } else { DomHandler.relativePosition(this.panel.element, this.container);